diff options
author | b14ckcat <b14ckcat@protonmail.com> | 2022-07-26 21:44:43 -0400 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-07-27 05:52:35 +0000 |
commit | b8cfec7b1f17a39b077cede16826b15cc67b686e (patch) | |
tree | 90c84f9a5207e80d08610f8bd272266ea7866086 /Kernel/FileSystem | |
parent | 4b1537387f0246c081fb96ceb974a63ea7f74c6a (diff) | |
download | serenity-b8cfec7b1f17a39b077cede16826b15cc67b686e.zip |
Kernel: Move SysFS USB create function
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp | 6 | ||||
-rw-r--r-- | Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp b/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp index 11863b07ea..cf3eda8d7f 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp +++ b/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/BusDirectory.cpp @@ -45,10 +45,4 @@ UNMAP_AFTER_INIT void SysFSUSBBusDirectory::initialize() 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)); -} - } diff --git a/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp b/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp index b18dfc469b..991dac7272 100644 --- a/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp +++ b/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp @@ -11,6 +11,12 @@ 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) : SysFSComponent() , m_device(device) |