From: Bartosz Golaszewski Date: Mon, 9 Jan 2017 12:18:42 +0000 (+0100) Subject: core: tweak the "line not requested" error code X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6358284443004e268893a82a7b237043bf0ca5b2;p=qemu-gpiodev%2Flibgpiod.git core: tweak the "line not requested" error code Signed-off-by: Bartosz Golaszewski --- diff --git a/core.c b/core.c index 0bf96a5..a55de83 100644 --- a/core.c +++ b/core.c @@ -471,7 +471,7 @@ int gpiod_line_get_value_bulk(struct gpiod_line_bulk *line_bulk, int *values) int status; if (!line_bulk_is_requested(line_bulk)) { - set_last_error(GPIOD_ENOTREQUESTED); + set_last_error(GPIOD_EREQUEST); return -1; } @@ -505,7 +505,7 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *line_bulk, int *values) int status; if (!line_bulk_is_requested(line_bulk)) { - set_last_error(GPIOD_ENOTREQUESTED); + set_last_error(GPIOD_EREQUEST); return -1; } diff --git a/gpiod.h b/gpiod.h index e75e3d2..c4f08c7 100644 --- a/gpiod.h +++ b/gpiod.h @@ -77,8 +77,8 @@ struct gpiod_chip_iter; enum { GPIOD_ESUCCESS = __GPIOD_ERRNO_OFFSET, /**< No error. */ - GPIOD_ENOTREQUESTED, - /**< GPIO line not requested. */ + GPIOD_EREQUEST, + /**< The caller has no ownership of this line. */ __GPIOD_MAX_ERR, /**< Private: number of libgpiod-specific error numbers. */ };