From 4ed3ff835c2862faea26acae9679d641476afed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Ekstr=C3=B6m?= Date: Fri, 22 Jul 2022 09:52:12 +0200 Subject: [PATCH] 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. --- src/libgpiodJtagBitbang.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libgpiodJtagBitbang.cpp b/src/libgpiodJtagBitbang.cpp index ccb0308..60c0211 100644 --- a/src/libgpiodJtagBitbang.cpp +++ b/src/libgpiodJtagBitbang.cpp @@ -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");