summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-05-24 17:57:23 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-05-24 17:59:46 +0200
commit5f6ce05fb54a4c8aef818d1dd3f6c9a6f9a4c168 (patch)
tree6b5fe04d45264f66eb7f72151ddd4b3fe4e92b1c
parent4894ccd9400cef581c93906afc3b21662b04da52 (diff)
downloadexynos-gpio-tool-5f6ce05fb54a4c8aef818d1dd3f6c9a6f9a4c168.tar.gz
exynos-gpio-tool-5f6ce05fb54a4c8aef818d1dd3f6c9a6f9a4c168.tar.bz2
exynos-gpio-tool-5f6ce05fb54a4c8aef818d1dd3f6c9a6f9a4c168.zip
compatible_devices: add debug flag
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--compatible_devices.c14
-rw-r--r--compatible_devices.h6
-rw-r--r--main.c2
-rw-r--r--tests.c4
4 files changed, 13 insertions, 13 deletions
diff --git a/compatible_devices.c b/compatible_devices.c
index bd35a0a..1feecbe 100644
--- a/compatible_devices.c
+++ b/compatible_devices.c
@@ -27,12 +27,12 @@
#include "compatible_devices.h"
-static int board_is_compatible(void)
+static int board_is_compatible(int debug)
{
return false;
}
-static int dt_is_compatible(void)
+static int dt_is_compatible(int debug)
{
int fd;
int rc;
@@ -99,18 +99,18 @@ static int dt_is_compatible(void)
return false;
}
-int device_is_compatible(void)
+int device_is_compatible(int debug)
{
- if (dt_is_compatible())
+ if (dt_is_compatible(debug))
return true;
- if (board_is_compatible())
+ if (board_is_compatible(debug))
return true;
return false;
}
-bool device_has_gpioget(void)
+bool device_has_gpioget(int debug)
{
int rc = 0;
@@ -121,7 +121,7 @@ bool device_has_gpioget(void)
return true;
}
-bool device_has_gpioset(void)
+bool device_has_gpioset(int debug)
{
int rc = 0;
diff --git a/compatible_devices.h b/compatible_devices.h
index b6a1b0a..5c0ea99 100644
--- a/compatible_devices.h
+++ b/compatible_devices.h
@@ -20,8 +20,8 @@
#include <stdbool.h>
-bool device_has_gpioget(void);
-bool device_has_gpioset(void);
-int device_is_compatible(void);
+bool device_has_gpioget(int debug);
+bool device_has_gpioset(int debug);
+int device_is_compatible(int debug);
#endif /* DETECT_DEVICE_H */
diff --git a/main.c b/main.c
index fad807b..876cca3 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ int main(int argc, char *argv[])
char *devmem = "/dev/mem";
size_t page_size = 4096;
- if (!device_is_compatible()) {
+ if (!device_is_compatible(debug)) {
printf("Exiting due to incompatible device\n");
return 0;
}
diff --git a/tests.c b/tests.c
index 37b34ca..a8f8db0 100644
--- a/tests.c
+++ b/tests.c
@@ -121,12 +121,12 @@ int run_tests(int debug, char *devmem, int fd, size_t page_size)
bool has_gpioget;
bool has_gpioset;
- has_gpioget = device_has_gpioget();
+ has_gpioget = device_has_gpioget(debug);
if (!has_gpioget) {
printf("[ !! ] gpioget not found: skipping tests\n");
}
- has_gpioset = device_has_gpioset();
+ has_gpioset = device_has_gpioset(debug);
if (!has_gpioset) {
printf("[ !! ] gpioset not found: skipping tests\n");
}