Add an error number indicating that a bulk operation was requested
on a set of lines not belonging to the same gpiochip.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
static const char *const error_descr[] = {
"success",
"GPIO line not requested",
+ "GPIO lines in bulk don't belong to the same gpiochip",
};
static void set_last_error(int errnum)
int status, fd;
unsigned int i;
- /* Paranoia: verify that all lines are from the same gpiochip. */
- if (!verify_line_bulk(line_bulk))
+ if (!verify_line_bulk(line_bulk)) {
+ set_last_error(GPIOD_EBULKINCOH);
return -1;
+ }
req = zalloc(sizeof(*req));
if (!req)
/**< No error. */
GPIOD_EREQUEST,
/**< The caller has no ownership of this line. */
+ GPIOD_EBULKINCOH,
+ /**< Not all lines in bulk belong to the same GPIO chip. */
__GPIOD_MAX_ERR,
/**< Private: number of libgpiod-specific error numbers. */
};