core: tweak the "line not requested" error code
authorBartosz Golaszewski <bartekgola@gmail.com>
Mon, 9 Jan 2017 12:18:42 +0000 (13:18 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Mon, 9 Jan 2017 12:18:42 +0000 (13:18 +0100)
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
core.c
gpiod.h

diff --git a/core.c b/core.c
index 0bf96a50a80363ace90949b64decbc48cd080314..a55de83870d4b972624ec30159fd43d32b899c03 100644 (file)
--- 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 e75e3d29a483de62e86a4b9dbf0feb187bf8a738..c4f08c7ae0a2165a3cc97db3e8d2fe18a1076cfa 100644 (file)
--- 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. */
 };