From c856ba2a49e28a32a590b2ecf336c8a526d02ce2 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Mon, 2 Mar 2020 10:46:56 +0100 Subject: [PATCH] ahci: report ports correctly Only use one report for devices report, not one per device fixes #3671 --- repos/os/src/drivers/ahci/main.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repos/os/src/drivers/ahci/main.cc b/repos/os/src/drivers/ahci/main.cc index 383667f90..9b1192c02 100644 --- a/repos/os/src/drivers/ahci/main.cc +++ b/repos/os/src/drivers/ahci/main.cc @@ -184,11 +184,11 @@ class Ahci::Driver : Noncopyable void report_ports(Reporter &reporter) { - auto report = [&](Port const &port, unsigned index, bool atapi) { + Reporter::Xml_generator xml(reporter, [&] () { - Block::Session::Info info = port.info(); - Reporter::Xml_generator xml(reporter, [&] () { + auto report = [&](Port const &port, unsigned index, bool atapi) { + Block::Session::Info info = port.info(); xml.node("port", [&] () { xml.attribute("num", index); xml.attribute("type", atapi ? "ATAPI" : "ATA"); @@ -199,10 +199,10 @@ class Ahci::Driver : Noncopyable xml.attribute("serial", _ata[index]->serial->cstring()); } }); - }); - }; + }; - for_each_port(report); + for_each_port(report); + }); } };