Skip to content

Commit

Permalink
Kernel/Storage: Remove StorageController reset and shutdown methods
Browse files Browse the repository at this point in the history
We never used these virtual methods outside their own implementation,
so let's stop pretending that we should be able to utilize this for
unknown purpose.
  • Loading branch information
supercomputer7 authored and ADKaster committed May 14, 2024
1 parent eadf2bf commit b4c2181
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 23 deletions.
5 changes: 0 additions & 5 deletions Kernel/Devices/Storage/AHCI/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ ErrorOr<void> AHCIController::reset()
return {};
}

ErrorOr<void> AHCIController::shutdown()
{
return Error::from_errno(ENOTIMPL);
}

size_t AHCIController::devices_count() const
{
SpinlockLocker locker(m_hba_control_lock);
Expand Down
4 changes: 2 additions & 2 deletions Kernel/Devices/Storage/AHCI/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class AHCIController final : public StorageController
virtual StringView device_name() const override { return "AHCI"sv; }

virtual LockRefPtr<StorageDevice> device(u32 index) const override;
virtual ErrorOr<void> reset() override;
virtual ErrorOr<void> shutdown() override;
virtual size_t devices_count() const override;
virtual void complete_current_request(AsyncDeviceRequest::RequestResult) override;

Expand All @@ -41,6 +39,8 @@ class AHCIController final : public StorageController
void handle_interrupt_for_port(Badge<AHCIInterruptHandler>, u32 port_index) const;

private:
ErrorOr<void> reset();

void disable_global_interrupts() const;
void enable_global_interrupts() const;

Expand Down
5 changes: 0 additions & 5 deletions Kernel/Devices/Storage/NVMe/NVMeController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ ErrorOr<void> NVMeController::reset()
return {};
}

ErrorOr<void> NVMeController::shutdown()
{
return Error::from_errno(ENOTIMPL);
}

void NVMeController::complete_current_request([[maybe_unused]] AsyncDeviceRequest::RequestResult result)
{
VERIFY_NOT_REACHED();
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Devices/Storage/NVMe/NVMeController.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class NVMeController : public PCI::Device
virtual StringView device_name() const override { return "NVMeController"sv; }

protected:
ErrorOr<void> reset() override;
ErrorOr<void> shutdown() override;
ErrorOr<void> reset();
void complete_current_request(AsyncDeviceRequest::RequestResult result) override;

public:
Expand Down
4 changes: 0 additions & 4 deletions Kernel/Devices/Storage/SD/SDHostController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ SDHostController::SDHostController()
{
}

ErrorOr<void> SDHostController::reset() { return ENOTIMPL; }

ErrorOr<void> SDHostController::shutdown() { return ENOTIMPL; }

void SDHostController::complete_current_request(AsyncDeviceRequest::RequestResult)
{
VERIFY_NOT_REACHED();
Expand Down
2 changes: 0 additions & 2 deletions Kernel/Devices/Storage/SD/SDHostController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class SDHostController : public StorageController {
virtual ~SDHostController() = default;

virtual LockRefPtr<StorageDevice> device(u32 index) const override { return index == 0 ? m_card : nullptr; }
virtual ErrorOr<void> reset() override;
virtual ErrorOr<void> shutdown() override;
virtual size_t devices_count() const override { return m_card ? 1 : 0; }
virtual void complete_current_request(AsyncDeviceRequest::RequestResult) override;

Expand Down
3 changes: 0 additions & 3 deletions Kernel/Devices/Storage/StorageController.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class StorageController : public AtomicRefCounted<StorageController> {
u32 hardware_relative_controller_id() const { return m_hardware_relative_controller_id; }

protected:
virtual ErrorOr<void> reset() = 0;
virtual ErrorOr<void> shutdown() = 0;

virtual void complete_current_request(AsyncDeviceRequest::RequestResult) = 0;

explicit StorageController(u32 hardware_relative_controller_id);
Expand Down

0 comments on commit b4c2181

Please sign in to comment.