From: Bartosz Golaszewski Date: Mon, 2 Oct 2017 13:16:44 +0000 (+0200) Subject: core: provide gpiod_line_bulk_num_lines() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=404968c9f51f229d3b99bbcbf2d1caf8177c5490;p=qemu-gpiodev%2Flibgpiod.git core: provide gpiod_line_bulk_num_lines() Add an inline routine allowing to retrieve the number of lines held by a line bulk object. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/gpiod.h b/include/gpiod.h index 6e13c64..8c672a9 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -431,6 +431,17 @@ gpiod_line_bulk_get_line(struct gpiod_line_bulk *bulk, unsigned int offset) return bulk->lines[offset]; } +/** + * @brief Retrieve the number of GPIO lines held by this line bulk object. + * @param bulk Line bulk object. + * @return Number of lines held by this line bulk. + */ +static inline unsigned int +gpiod_line_bulk_num_lines(struct gpiod_line_bulk *bulk) +{ + return bulk->num_lines; +} + /** * @} *