diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2020-09-30 11:35:56 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-09-30 11:35:56 +0200 |
commit | 3d5a46544b97ca1c446e13f4aa1b0f811e5a0a7c (patch) | |
tree | 05cad20d35499986c1f9b6be8d4146842108f327 /tools/gpio/gpio-watch.c | |
parent | 12d16b397ce0a999d13762c4c0cae2fb82eb60ee (diff) | |
parent | cf048e05b68789e9fa35f246f8ecbe95d79f4173 (diff) |
Merge tag 'gpio-updates-for-v5.10-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio updates for v5.10 - part 2
- refactor gpio-mockup testing module
- simplify the code in gpio-mpc8xxx
- implement v2 of the GPIO user API
Diffstat (limited to 'tools/gpio/gpio-watch.c')
-rw-r--r-- | tools/gpio/gpio-watch.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/gpio/gpio-watch.c b/tools/gpio/gpio-watch.c index 5cea24fddfa7..f229ec62301b 100644 --- a/tools/gpio/gpio-watch.c +++ b/tools/gpio/gpio-watch.c @@ -21,8 +21,8 @@ int main(int argc, char **argv) { - struct gpioline_info_changed chg; - struct gpioline_info req; + struct gpio_v2_line_info_changed chg; + struct gpio_v2_line_info req; struct pollfd pfd; int fd, i, j, ret; char *event, *end; @@ -40,11 +40,11 @@ int main(int argc, char **argv) for (i = 0, j = 2; i < argc - 2; i++, j++) { memset(&req, 0, sizeof(req)); - req.line_offset = strtoul(argv[j], &end, 0); + req.offset = strtoul(argv[j], &end, 0); if (*end != '\0') goto err_usage; - ret = ioctl(fd, GPIO_GET_LINEINFO_WATCH_IOCTL, &req); + ret = ioctl(fd, GPIO_V2_GET_LINEINFO_WATCH_IOCTL, &req); if (ret) { perror("unable to set up line watch"); return EXIT_FAILURE; @@ -71,13 +71,13 @@ int main(int argc, char **argv) } switch (chg.event_type) { - case GPIOLINE_CHANGED_REQUESTED: + case GPIO_V2_LINE_CHANGED_REQUESTED: event = "requested"; break; - case GPIOLINE_CHANGED_RELEASED: + case GPIO_V2_LINE_CHANGED_RELEASED: event = "released"; break; - case GPIOLINE_CHANGED_CONFIG: + case GPIO_V2_LINE_CHANGED_CONFIG: event = "config changed"; break; default: @@ -87,7 +87,7 @@ int main(int argc, char **argv) } printf("line %u: %s at %llu\n", - chg.info.line_offset, event, chg.timestamp); + chg.info.offset, event, chg.timestamp_ns); } } |