diff options
author | Luke <luke.wilde@live.co.uk> | 2021-08-13 20:47:16 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-14 21:22:44 +0200 |
commit | 86ccacf6b52ddfdfadd0617b8d35c91e64cb1939 (patch) | |
tree | c427257803bd5133404b8aa115c393305898e4dd | |
parent | da0a1068e94bad11967de15b9bd36864acb5ac9a (diff) | |
download | serenity-86ccacf6b52ddfdfadd0617b8d35c91e64cb1939.zip |
Kernel/USB: Remove get_device_{at_port,from_address}
Nothing was using these. These can be put back in the future if
required. This also allows removing the devices array in UHCI.
-rw-r--r-- | Kernel/Bus/USB/UHCIController.cpp | 21 | ||||
-rw-r--r-- | Kernel/Bus/USB/UHCIController.h | 5 | ||||
-rw-r--r-- | Kernel/Bus/USB/USBController.h | 3 |
3 files changed, 0 insertions, 29 deletions
diff --git a/Kernel/Bus/USB/UHCIController.cpp b/Kernel/Bus/USB/UHCIController.cpp index bbcd2d680f..fbae95bac5 100644 --- a/Kernel/Bus/USB/UHCIController.cpp +++ b/Kernel/Bus/USB/UHCIController.cpp @@ -254,27 +254,6 @@ UNMAP_AFTER_INIT UHCIController::~UHCIController() { } -RefPtr<USB::Device> const UHCIController::get_device_at_port(USB::Device::PortNumber port) -{ - if (!m_devices.at(to_underlying(port))) - return nullptr; - - return m_devices.at(to_underlying(port)); -} - -RefPtr<USB::Device> const UHCIController::get_device_from_address(u8 device_address) -{ - for (auto const& device : m_devices) { - if (!device) - continue; - - if (device->address() == device_address) - return device; - } - - return nullptr; -} - KResult UHCIController::reset() { if (auto stop_result = stop(); stop_result.is_error()) diff --git a/Kernel/Bus/USB/UHCIController.h b/Kernel/Bus/USB/UHCIController.h index 975fdf0454..88125482e7 100644 --- a/Kernel/Bus/USB/UHCIController.h +++ b/Kernel/Bus/USB/UHCIController.h @@ -42,9 +42,6 @@ public: virtual KResultOr<size_t> submit_control_transfer(Transfer& transfer) override; - virtual RefPtr<USB::Device> const get_device_at_port(USB::Device::PortNumber) override; - virtual RefPtr<USB::Device> const get_device_from_address(u8 device_address) override; - void get_port_status(Badge<UHCIRootHub>, u8, HubStatus&); KResult set_port_feature(Badge<UHCIRootHub>, u8, HubFeatureSelector); KResult clear_port_feature(Badge<UHCIRootHub>, u8, HubFeatureSelector); @@ -109,8 +106,6 @@ private: // Bitfield containing whether a given port should signal a change in suspend or not. u8 m_port_suspend_change_statuses { 0 }; - - Array<RefPtr<USB::Device>, NUMBER_OF_ROOT_PORTS> m_devices; // Devices connected to the root ports (of which there are two) }; } diff --git a/Kernel/Bus/USB/USBController.h b/Kernel/Bus/USB/USBController.h index 065dbb166d..902387a69f 100644 --- a/Kernel/Bus/USB/USBController.h +++ b/Kernel/Bus/USB/USBController.h @@ -25,9 +25,6 @@ public: virtual KResultOr<size_t> submit_control_transfer(Transfer&) = 0; - virtual RefPtr<USB::Device> const get_device_at_port(USB::Device::PortNumber) = 0; - virtual RefPtr<USB::Device> const get_device_from_address(u8) = 0; - u8 allocate_address(); private: |