diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-11-09 11:38:42 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-11-09 11:38:42 +0300 |
commit | bee67c7c9d7d3252dce69c960a53e53fd6b04e09 (patch) | |
tree | e01f03a5c4530936c734508ec75ca82b37b484b8 /tools/gpio/gpio-utils.c | |
parent | 756a024f3983093d26a8756fe4677e34b38bd519 (diff) | |
parent | 9e9355bb2096c3a9e8baa2ff2e09ac43eeeadc72 (diff) | |
download | linux-bee67c7c9d7d3252dce69c960a53e53fd6b04e09.tar.xz |
Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel
Diffstat (limited to 'tools/gpio/gpio-utils.c')
-rw-r--r-- | tools/gpio/gpio-utils.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/gpio/gpio-utils.c b/tools/gpio/gpio-utils.c index b86a32d90d88..cf7e2f3419ee 100644 --- a/tools/gpio/gpio-utils.c +++ b/tools/gpio/gpio-utils.c @@ -76,7 +76,8 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, fd = open(chrdev_name, 0); if (fd == -1) { ret = -errno; - fprintf(stderr, "Failed to open %s\n", chrdev_name); + fprintf(stderr, "Failed to open %s, %s\n", + chrdev_name, strerror(errno)); goto exit_close_error; } @@ -92,8 +93,8 @@ int gpiotools_request_linehandle(const char *device_name, unsigned int *lines, ret = ioctl(fd, GPIO_GET_LINEHANDLE_IOCTL, &req); if (ret == -1) { ret = -errno; - fprintf(stderr, "Failed to issue GET LINEHANDLE IOCTL (%d)\n", - ret); + fprintf(stderr, "Failed to issue %s (%d), %s\n", + "GPIO_GET_LINEHANDLE_IOCTL", ret, strerror(errno)); } exit_close_error: @@ -118,8 +119,9 @@ int gpiotools_set_values(const int fd, struct gpiohandle_data *data) ret = ioctl(fd, GPIOHANDLE_SET_LINE_VALUES_IOCTL, data); if (ret == -1) { ret = -errno; - fprintf(stderr, "Failed to issue %s (%d)\n", - "GPIOHANDLE_SET_LINE_VALUES_IOCTL", ret); + fprintf(stderr, "Failed to issue %s (%d), %s\n", + "GPIOHANDLE_SET_LINE_VALUES_IOCTL", ret, + strerror(errno)); } return ret; @@ -141,8 +143,9 @@ int gpiotools_get_values(const int fd, struct gpiohandle_data *data) ret = ioctl(fd, GPIOHANDLE_GET_LINE_VALUES_IOCTL, data); if (ret == -1) { ret = -errno; - fprintf(stderr, "Failed to issue %s (%d)\n", - "GPIOHANDLE_GET_LINE_VALUES_IOCTL", ret); + fprintf(stderr, "Failed to issue %s (%d), %s\n", + "GPIOHANDLE_GET_LINE_VALUES_IOCTL", ret, + strerror(errno)); } return ret; |