File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ USB_DEVICE_DRIVER(HIDDriver);
9191void HIDDriver::init ()
9292{
9393 auto driver = MUST (adopt_nonnull_lock_ref_or_enomem (new (nothrow) HIDDriver ()));
94- USBManagement::register_driver (driver);
94+ MUST ( USBManagement::register_driver (driver) );
9595}
9696
9797static constexpr u8 DESCRIPTOR_TYPE_HID = 0x21 ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ USB_DEVICE_DRIVER(MassStorageDriver);
2323void MassStorageDriver::init ()
2424{
2525 auto driver = MUST (adopt_nonnull_lock_ref_or_enomem (new MassStorageDriver ()));
26- USBManagement::register_driver (driver);
26+ MUST ( USBManagement::register_driver (driver) );
2727}
2828
2929ErrorOr<void > MassStorageDriver::probe (USB::Device& device)
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ UNMAP_AFTER_INIT USBManagement::USBManagement()
2020 SysFSUSBBusDirectory::initialize ();
2121}
2222
23- void USBManagement::register_driver (NonnullLockRefPtr<Driver> driver)
23+ ErrorOr< void > USBManagement::register_driver (NonnullLockRefPtr<Driver> driver)
2424{
2525 dbgln_if (USB_DEBUG, " Registering driver {}" , driver->name ());
26- s_available_drivers->append (driver);
26+ return s_available_drivers->try_append (driver);
2727}
2828
2929LockRefPtr<Driver> USBManagement::get_driver_by_name (StringView name)
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class USBManagement {
1919 USBManagement ();
2020 static USBManagement& the ();
2121
22- static void register_driver (NonnullLockRefPtr<Driver> driver);
22+ static ErrorOr< void > register_driver (NonnullLockRefPtr<Driver> driver);
2323 static LockRefPtr<Driver> get_driver_by_name (StringView name);
2424 static void unregister_driver (NonnullLockRefPtr<Driver> driver);
2525
You can’t perform that action at this time.
0 commit comments