mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +00:00
Kernel: Propagate errors with TRY()
where possible
This commit is contained in:
parent
89c0e3541e
commit
532f2b644c
2 changed files with 3 additions and 3 deletions
|
@ -92,7 +92,7 @@ ErrorOr<void> Device::setup_queues(u16 requested_queue_count)
|
||||||
VERIFY(!m_did_setup_queues);
|
VERIFY(!m_did_setup_queues);
|
||||||
m_did_setup_queues = true;
|
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) {
|
if (common_cfg) {
|
||||||
auto maximum_queue_count = m_transport_entity->config_read16(*common_cfg, COMMON_CFG_NUM_QUEUES);
|
auto maximum_queue_count = m_transport_entity->config_read16(*common_cfg, COMMON_CFG_NUM_QUEUES);
|
||||||
if (requested_queue_count == 0) {
|
if (requested_queue_count == 0) {
|
||||||
|
|
|
@ -64,7 +64,7 @@ ErrorOr<void> AHCIController::reset()
|
||||||
|
|
||||||
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
|
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
|
||||||
for (auto index : implemented_ports.to_vector()) {
|
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;
|
m_ports[index] = port;
|
||||||
port->reset();
|
port->reset();
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ UNMAP_AFTER_INIT ErrorOr<void> AHCIController::initialize_hba(PCI::DeviceIdentif
|
||||||
enable_global_interrupts();
|
enable_global_interrupts();
|
||||||
|
|
||||||
auto implemented_ports = AHCI::MaskedBitField((u32 volatile&)(hba().control_regs.pi));
|
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());
|
TRY(reset());
|
||||||
|
|
||||||
dbgln_if(AHCI_DEBUG, "{}: AHCI Controller Version = {:#08x}", device_identifier().address(), version);
|
dbgln_if(AHCI_DEBUG, "{}: AHCI Controller Version = {:#08x}", device_identifier().address(), version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue