Clarify code by using different API function

Use gpiod_chip_open instead of gpiod_chip_open_by_name, and thus avoid
having to remove "/dev/" prefix.
This commit is contained in:
Niklas Ekström
2022-07-22 09:52:12 +02:00
parent 8d920d7ed0
commit 4ed3ff835c
+1 -1
View File
@@ -69,7 +69,7 @@ LibgpiodJtagBitbang::LibgpiodJtagBitbang(
}
}
_chip = gpiod_chip_open_by_name(chip_dev.substr(5).c_str());
_chip = gpiod_chip_open(chip_dev.c_str());
if (!_chip) {
display("Unable to open gpio chip %s\n", chip_dev.c_str());
throw std::runtime_error("Unable to open gpio chip\n");