Skip to content

Commit

Permalink
attach implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnoreWarnings committed Jul 31, 2024
1 parent 954f0c2 commit 59776bf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fpga/lib/devices/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ void Driver::unbind(const Device &device) const {
write_to_file(device.name(), this->unbind_path);
};

void Driver::bind(const Device &device) const {
void Driver::attach(const Device &device) const {
// If driver is attached unbind it
// if (device.driver().has_value()) {
// device.driver().value().unbind(device);
// }
//override(device);
write_to_file(device.name(), this->bind_path);

override(device);

write_to_file(device.name(),
std::filesystem::path("/sys/bus/platform/drivers_probe"));
}

void Driver::override(const Device &device) const {
write_to_file(this->name(), std::filesystem::path(device.path.u8string() +
"/driver_override"));
"/driver_override"));
};

std::string Driver::name() const {
Expand Down

0 comments on commit 59776bf

Please sign in to comment.