Kernel/USB: Tighten up USBManagement enumeration code a bit

This commit is contained in:
Liav A 2021-08-09 23:16:24 +03:00 committed by Andreas Kling
parent 1479ee3f3e
commit d16d116b65
Notes: sideshowbarker 2024-07-18 07:10:42 +09:00

View file

@ -22,9 +22,12 @@ UNMAP_AFTER_INIT USBManagement::USBManagement()
UNMAP_AFTER_INIT void USBManagement::enumerate_controllers()
{
if (!kernel_command_line().disable_usb()) {
if (kernel_command_line().disable_usb())
return;
PCI::enumerate([this](PCI::Address const& address, PCI::ID) {
if (PCI::get_class(address) == 0xc && PCI::get_subclass(address) == 0x3) {
if (!(PCI::get_class(address) == 0xc && PCI::get_subclass(address) == 0x3))
return;
if (PCI::get_programming_interface(address) == 0x0) {
if (kernel_command_line().disable_uhci_controller())
return;
@ -51,9 +54,7 @@ UNMAP_AFTER_INIT void USBManagement::enumerate_controllers()
}
dmesgln("USBManagement: Unknown/unsupported controller at {} with programming interface 0x{:02x}", address, PCI::get_programming_interface(address));
}
});
}
}
bool USBManagement::initialized()