/**< Not all lines in bulk belong to the same GPIO chip. */
GPIOD_ELINEBUSY,
/**< This line is currently in use. */
+ GPIOD_ELINEMAX,
+ /**< Number of lines in the request exceeds limit. */
__GPIOD_MAX_ERR,
/**< Private: number of libgpiod-specific error numbers. */
};
"no events configured on GPIO line",
"GPIO lines in bulk don't belong to the same gpiochip",
"GPIO line currently in use",
+ "number of lines in the request exceeds limit",
};
static void set_last_error(int errnum)
unsigned int i;
int status;
+ if (num_lines > GPIOD_REQUEST_MAX_LINES) {
+ set_last_error(GPIOD_ELINEMAX);
+ return -1;
+ }
+
chip = gpiod_chip_open_lookup(device);
if (!chip)
return -1;
unsigned int i;
int status;
+ if (num_lines > GPIOD_REQUEST_MAX_LINES) {
+ set_last_error(GPIOD_ELINEMAX);
+ return -1;
+ }
+
chip = gpiod_chip_open_lookup(device);
if (!chip)
return -1;