core: provide gpiod_line_bulk_num_lines()
authorBartosz Golaszewski <bartekgola@gmail.com>
Mon, 2 Oct 2017 13:16:44 +0000 (15:16 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Mon, 2 Oct 2017 13:16:44 +0000 (15:16 +0200)
Add an inline routine allowing to retrieve the number of lines held by
a line bulk object.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h

index 6e13c641304c14cfb93bbbfff628cffb807f7fc2..8c672a9922b288a36753d9f00914b4074b495762 100644 (file)
@@ -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;
+}
+
 /**
  * @}
  *