summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp')
-rw-r--r--Kernel/FileSystem/SysFS/Subsystems/Bus/USB/DeviceInformation.cpp6
1 files changed, 6 insertions, 0 deletions
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)