From 68d8bb230fbe5d3725340a9eafb45e4ae008cf27 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 11 Jan 2017 14:11:43 +0100 Subject: [PATCH] core: un-inline gpiod_line_iter_next() This function grew to the point where it should go into a .c file. Signed-off-by: Bartosz Golaszewski --- core.c | 17 +++++++++++++++++ gpiod.h | 19 ++----------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/core.c b/core.c index e139f22..8051783 100644 --- a/core.c +++ b/core.c @@ -1077,3 +1077,20 @@ gpiod_chip_iter_failed_chip(struct gpiod_chip_iter *iter) { return iter->failed_chip; } + +struct gpiod_line * gpiod_line_iter_next(struct gpiod_line_iter *iter) +{ + struct gpiod_line *line; + + if (iter->offset >= gpiod_chip_num_lines(iter->chip)) { + iter->state = GPIOD_LINE_ITER_DONE; + return NULL; + } + + iter->state = GPIOD_LINE_ITER_INIT; + line = gpiod_chip_get_line(iter->chip, iter->offset++); + if (!line) + iter->state = GPIOD_LINE_ITER_ERR; + + return line; +} diff --git a/gpiod.h b/gpiod.h index fca5e0b..2338ecf 100644 --- a/gpiod.h +++ b/gpiod.h @@ -835,23 +835,8 @@ static inline void gpiod_line_iter_init(struct gpiod_line_iter *iter, * @return Pointer to the next GPIO line handle or NULL if no more lines or * and error occured. */ -static inline struct gpiod_line * -gpiod_line_iter_next(struct gpiod_line_iter *iter) -{ - struct gpiod_line *line; - - if (iter->offset >= gpiod_chip_num_lines(iter->chip)) { - iter->state = GPIOD_LINE_ITER_DONE; - return NULL; - } - - iter->state = GPIOD_LINE_ITER_INIT; - line = gpiod_chip_get_line(iter->chip, iter->offset++); - if (!line) - iter->state = GPIOD_LINE_ITER_ERR; - - return line; -} +struct gpiod_line * +gpiod_line_iter_next(struct gpiod_line_iter *iter) GPIOD_API; /** * @brief Check if we're done iterating over lines on this iterator. -- 2.30.2