Kernel: Propagate errors with TRY() where possible

This commit is contained in:
Tim Ledbetter 2024-02-07 20:40:34 +00:00 committed by Tim Flynn
parent 89c0e3541e
commit 532f2b644c
Notes: sideshowbarker 2024-07-17 20:58:35 +09:00
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ ErrorOr<void> Device::setup_queues(u16 requested_queue_count)
VERIFY(!m_did_setup_queues);
m_did_setup_queues = true;
auto* common_cfg = m_transport_entity->get_config(ConfigurationType::Common).release_value_but_fixme_should_propagate_errors();
auto* common_cfg = TRY(m_transport_entity->get_config(ConfigurationType::Common));
if (common_cfg) {
auto maximum_queue_count = m_transport_entity->config_read16(*common_cfg, COMMON_CFG_NUM_QUEUES);
if (requested_queue_count == 0) {

View File

@ -64,7 +64,7 @@ ErrorOr<void> AHCIController::reset()
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
for (auto index : implemented_ports.to_vector()) {
auto port = AHCIPort::create(*this, m_hba_capabilities, static_cast<volatile AHCI::PortRegisters&>(hba().port_regs[index]), index).release_value_but_fixme_should_propagate_errors();
auto port = TRY(AHCIPort::create(*this, m_hba_capabilities, static_cast<volatile AHCI::PortRegisters&>(hba().port_regs[index]), index));
m_ports[index] = port;
port->reset();
}
@ -174,7 +174,7 @@ UNMAP_AFTER_INIT ErrorOr<void> AHCIController::initialize_hba(PCI::DeviceIdentif
enable_global_interrupts();
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
m_irq_handler = AHCIInterruptHandler::create(*this, irq, implemented_ports).release_value_but_fixme_should_propagate_errors();
m_irq_handler = TRY(AHCIInterruptHandler::create(*this, irq, implemented_ports));
TRY(reset());
dbgln_if(AHCI_DEBUG, "{}: AHCI Controller Version = {:#08x}", device_identifier().address(), version);