mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-04 01:12:56 +00:00
Kernel: Move SysFS USB create function
This commit is contained in:
parent
4b1537387f
commit
b8cfec7b1f
Notes:
sideshowbarker
2024-07-17 08:32:33 +09:00
Author: https://github.com/b14ckcat
Commit: b8cfec7b1f
Pull-request: https://github.com/SerenityOS/serenity/pull/14703
Reviewed-by: https://github.com/bgianfo ✅
2 changed files with 6 additions and 6 deletions
|
@ -45,10 +45,4 @@ UNMAP_AFTER_INIT void SysFSUSBBusDirectory::initialize()
|
||||||
s_sysfs_usb_bus_directory = directory;
|
s_sysfs_usb_bus_directory = directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<NonnullRefPtr<SysFSUSBDeviceInformation>> SysFSUSBDeviceInformation::create(USB::Device& device)
|
|
||||||
{
|
|
||||||
auto device_name = TRY(KString::number(device.address()));
|
|
||||||
return adopt_nonnull_ref_or_enomem(new (nothrow) SysFSUSBDeviceInformation(move(device_name), device));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
|
ErrorOr<NonnullRefPtr<SysFSUSBDeviceInformation>> SysFSUSBDeviceInformation::create(USB::Device& device)
|
||||||
|
{
|
||||||
|
auto device_name = TRY(KString::number(device.address()));
|
||||||
|
return adopt_nonnull_ref_or_enomem(new (nothrow) SysFSUSBDeviceInformation(move(device_name), device));
|
||||||
|
}
|
||||||
|
|
||||||
SysFSUSBDeviceInformation::SysFSUSBDeviceInformation(NonnullOwnPtr<KString> device_name, USB::Device& device)
|
SysFSUSBDeviceInformation::SysFSUSBDeviceInformation(NonnullOwnPtr<KString> device_name, USB::Device& device)
|
||||||
: SysFSComponent()
|
: SysFSComponent()
|
||||||
, m_device(device)
|
, m_device(device)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue