diff --git a/common/include/villas/kernel/devices/platform_device.hpp b/common/include/villas/kernel/devices/platform_device.hpp index 673694387..a9be31c03 100644 --- a/common/include/villas/kernel/devices/platform_device.hpp +++ b/common/include/villas/kernel/devices/platform_device.hpp @@ -11,6 +11,7 @@ #include #include #include +#include namespace villas { namespace kernel { diff --git a/common/lib/kernel/devices/platform_device.cpp b/common/lib/kernel/devices/platform_device.cpp index e1f3610c6..b66a19577 100644 --- a/common/lib/kernel/devices/platform_device.cpp +++ b/common/lib/kernel/devices/platform_device.cpp @@ -6,13 +6,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include #include -#include +#include -using villas::kernel::devices::Driver, villas::kernel::devices::LinuxDriver; +using villas::kernel::devices::Driver, villas::kernel::devices::GenericDriver; using villas::kernel::devices::PlatformDevice; -using villas::utils::write_to_file; +using villas::kernel::devices::utils::write_to_file; std::optional> PlatformDevice::driver() const { std::filesystem::path driver_symlink = @@ -23,7 +22,7 @@ std::optional> PlatformDevice::driver() const { std::filesystem::path driver_path = std::filesystem::canonical(driver_symlink); - return std::make_optional(std::make_unique(driver_path)); + return std::make_optional(std::make_unique(driver_path)); } std::optional PlatformDevice::iommu_group() const { @@ -47,4 +46,7 @@ std::filesystem::path PlatformDevice::override_path() const { return this->m_override_path; } -std::string PlatformDevice::name() const { return this->m_path.filename(); } +std::string PlatformDevice::name() const { + size_t pos = this->m_path.u8string().rfind('/'); + return this->m_path.u8string().substr(pos + 1); +}