mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Kernel: Propagate HIDManagement initialisation error to init
Initialisation errors for HIDManagement are now returned to the init. In the init we assert by MUST if we get an error.
This commit is contained in:
parent
d3ce97e8b2
commit
78f8821152
Notes:
sideshowbarker
2024-07-17 16:38:26 +09:00
Author: https://github.com/L0ric0 Commit: https://github.com/SerenityOS/serenity/commit/78f8821152 Pull-request: https://github.com/SerenityOS/serenity/pull/12746 Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/supercomputer7
4 changed files with 4 additions and 7 deletions
|
@ -137,12 +137,11 @@ UNMAP_AFTER_INIT ErrorOr<void> HIDManagement::enumerate()
|
|||
return {};
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT void HIDManagement::initialize()
|
||||
UNMAP_AFTER_INIT ErrorOr<void> HIDManagement::initialize()
|
||||
{
|
||||
VERIFY(!s_the.is_initialized());
|
||||
s_the.ensure_instance();
|
||||
// FIXME: Propagate errors back to init to deal with them.
|
||||
MUST(s_the->enumerate());
|
||||
return s_the->enumerate();
|
||||
}
|
||||
|
||||
HIDManagement& HIDManagement::the()
|
||||
|
|
|
@ -35,7 +35,7 @@ class HIDManagement {
|
|||
|
||||
public:
|
||||
HIDManagement();
|
||||
static void initialize();
|
||||
static ErrorOr<void> initialize();
|
||||
static HIDManagement& the();
|
||||
|
||||
ErrorOr<void> enumerate();
|
||||
|
|
|
@ -154,7 +154,6 @@ ErrorOr<u8> PS2MouseDevice::send_command(u8 command)
|
|||
|
||||
if (response != I8042Response::Acknowledge) {
|
||||
dbgln("PS2MouseDevice: Command {} got {} but expected ack: {}", command, response, static_cast<u8>(I8042Response::Acknowledge));
|
||||
// FIXME: Is this the correct errno value for this?
|
||||
return Error::from_errno(EIO);
|
||||
}
|
||||
return response;
|
||||
|
@ -165,7 +164,6 @@ ErrorOr<u8> PS2MouseDevice::send_command(u8 command, u8 data)
|
|||
u8 response = TRY(m_i8042_controller->send_command(instrument_type(), command, data));
|
||||
if (response != I8042Response::Acknowledge) {
|
||||
dbgln("PS2MouseDevice: Command {} got {} but expected ack: {}", command, response, static_cast<u8>(I8042Response::Acknowledge));
|
||||
// FIXME: Is this the correct errno value for this?
|
||||
return Error::from_errno(EIO);
|
||||
}
|
||||
return response;
|
||||
|
|
|
@ -326,7 +326,7 @@ void init_stage2(void*)
|
|||
(void)SerialDevice::must_create(3).leak_ref();
|
||||
|
||||
VMWareBackdoor::the(); // don't wait until first mouse packet
|
||||
HIDManagement::initialize();
|
||||
MUST(HIDManagement::initialize());
|
||||
|
||||
GraphicsManagement::the().initialize();
|
||||
ConsoleManagement::the().initialize();
|
||||
|
|
Loading…
Reference in a new issue