From 404968c9f51f229d3b99bbcbf2d1caf8177c5490 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 2 Oct 2017 15:16:44 +0200 Subject: [PATCH] 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 --- include/gpiod.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; +} + /** * @} * -- 2.30.2