1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 10:34:58 +00:00

Kernel: Allow AHCIController::initialize() to fail

If we fail to initialize an AHCI controller, we now skip adding it to
the list of storage controllers in StorageManagement.
This commit is contained in:
Julian Offenhäuser 2023-03-14 14:13:50 +01:00 committed by Andreas Kling
parent d1e88a5141
commit 5541dfd9f8
3 changed files with 13 additions and 7 deletions

View file

@ -111,7 +111,10 @@ UNMAP_AFTER_INIT void StorageManagement::enumerate_pci_controllers(bool force_pi
if (subclass_code == SubclassID::SATAController
&& device_identifier.prog_if().value() == to_underlying(PCI::MassStorage::SATAProgIF::AHCI)) {
m_controllers.append(AHCIController::initialize(device_identifier));
if (auto ahci_controller_or_error = AHCIController::initialize(device_identifier); !ahci_controller_or_error.is_error())
m_controllers.append(ahci_controller_or_error.value());
else
dmesgln("Unable to initialize AHCI controller: {}", ahci_controller_or_error.error());
}
if (subclass_code == SubclassID::NVMeController) {
auto controller = NVMeController::try_initialize(device_identifier, nvme_poll);