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.
This commit is contained in:
Luke 2021-08-13 20:47:16 +01:00 committed by Andreas Kling
parent da0a1068e9
commit 86ccacf6b5
Notes: sideshowbarker 2024-07-18 05:43:46 +09:00
3 changed files with 0 additions and 29 deletions

View File

@ -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())

View File

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

View File

@ -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: