ahci: report ports correctly

Only use one report for devices report, not one per device

fixes #3671
This commit is contained in:
Sebastian Sumpf 2020-03-02 10:46:56 +01:00 committed by Christian Helmuth
parent 1087e3f59e
commit c856ba2a49
1 changed files with 6 additions and 6 deletions

View File

@ -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);
});
}
};