Skip to content

Commit 6d3b492

Browse files
rename GenericDriver to LinuxDriver
1 parent 30a0e6b commit 6d3b492

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

common/include/villas/kernel/devices/generic_driver.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* GenericDriver - Works for standard Linux drivers
1+
/* Implementation of driver interface for Linux/Unix based operation system drivers.
22
*
33
* Author: Pascal Bauer <[email protected]>
44
*
@@ -17,7 +17,7 @@ namespace villas {
1717
namespace kernel {
1818
namespace devices {
1919

20-
class GenericDriver : public Driver {
20+
class LinuxDriver : public Driver {
2121
private:
2222
static constexpr char BIND_DEFAULT[] = "bind";
2323
static constexpr char UNBIND_DEFAULT[] = "unbind";
@@ -30,13 +30,13 @@ class GenericDriver : public Driver {
3030
const std::filesystem::path unbind_path;
3131

3232
public:
33-
GenericDriver(const std::filesystem::path path)
34-
: GenericDriver(path, path / std::filesystem::path(BIND_DEFAULT),
35-
path / std::filesystem::path(UNBIND_DEFAULT)){};
33+
LinuxDriver(const std::filesystem::path path)
34+
: LinuxDriver(path, path / std::filesystem::path(BIND_DEFAULT),
35+
path / std::filesystem::path(UNBIND_DEFAULT)){};
3636

37-
GenericDriver(const std::filesystem::path path,
38-
const std::filesystem::path bind_path,
39-
const std::filesystem::path unbind_path)
37+
LinuxDriver(const std::filesystem::path path,
38+
const std::filesystem::path bind_path,
39+
const std::filesystem::path unbind_path)
4040
: path(path), bind_path(bind_path), unbind_path(unbind_path){};
4141

4242
public:
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* GenericDriver
1+
/* LinuxDriver
22
*
33
* Author: Pascal Bauer <[email protected]>
44
*
@@ -11,30 +11,30 @@
1111
#include <villas/kernel/devices/device.hpp>
1212
#include <villas/utils.hpp>
1313

14-
using villas::kernel::devices::Device, villas::kernel::devices::GenericDriver;
14+
using villas::kernel::devices::Device, villas::kernel::devices::LinuxDriver;
1515
using villas::utils::write_to_file;
1616

17-
void GenericDriver::attach(const Device &device) const {
17+
void LinuxDriver::attach(const Device &device) const {
1818
if (device.driver().has_value()) {
1919
device.driver().value()->unbind(device);
2020
}
2121
this->override(device);
2222
device.probe();
2323
}
2424

25-
void GenericDriver::bind(const Device &device) const {
25+
void LinuxDriver::bind(const Device &device) const {
2626
write_to_file(device.name(), this->bind_path);
2727
}
2828

29-
std::string GenericDriver::name() const {
29+
std::string LinuxDriver::name() const {
3030
size_t pos = path.u8string().rfind('/');
3131
return path.u8string().substr(pos + 1);
3232
}
3333

34-
void GenericDriver::override(const Device &device) const {
34+
void LinuxDriver::override(const Device &device) const {
3535
write_to_file(this->name(), device.override_path());
3636
}
3737

38-
void GenericDriver::unbind(const Device &device) const {
38+
void LinuxDriver::unbind(const Device &device) const {
3939
write_to_file(device.name(), this->unbind_path);
4040
}

common/lib/kernel/devices/platform_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <villas/kernel/devices/platform_device.hpp>
1111
#include <villas/utils.hpp>
1212

13-
using villas::kernel::devices::Driver, villas::kernel::devices::GenericDriver;
13+
using villas::kernel::devices::Driver, villas::kernel::devices::LinuxDriver;
1414
using villas::kernel::devices::PlatformDevice;
1515
using villas::utils::write_to_file;
1616

@@ -23,7 +23,7 @@ std::optional<std::unique_ptr<Driver>> PlatformDevice::driver() const {
2323

2424
std::filesystem::path driver_path =
2525
std::filesystem::canonical(driver_symlink);
26-
return std::make_optional(std::make_unique<GenericDriver>(driver_path));
26+
return std::make_optional(std::make_unique<LinuxDriver>(driver_path));
2727
}
2828

2929
std::optional<int> PlatformDevice::iommu_group() const {

0 commit comments

Comments
 (0)