[PATCH 1/2] fixup! gpio: fix static inline stub selection
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Jan 6 22:49:44 PST 2025
gpiod_count depends on OFDEVICE, but the stub was so far only defined
for CONFIG_GPIOLIB-less systems ignoring OFDEVICE. Move it into the
correct #ifdef branch to fix CI failure.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
include/linux/gpio/consumer.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index c5c9e14e4053..7dfac56239eb 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -66,6 +66,8 @@ struct gpio_desc *__must_check gpiod_get_index_optional(struct device *dev,
unsigned int index,
enum gpiod_flags flags);
+int gpiod_count(struct device *dev, const char *con_id);
+
struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
const char *con_id,
enum gpiod_flags flags);
@@ -96,6 +98,11 @@ gpiod_get_index_optional(struct device *dev, const char *con_id,
return NULL;
}
+static inline int gpiod_count(struct device *dev, const char *con_id)
+{
+ return 0;
+}
+
static inline struct gpio_descs *__must_check
gpiod_get_array(struct device *dev, const char *con_id, enum gpiod_flags flags)
{
@@ -122,8 +129,6 @@ void gpiod_put(struct gpio_desc *desc);
int gpiod_set_consumer_name(struct gpio_desc *desc, const char *name);
-int gpiod_count(struct device *dev, const char *con_id);
-
void gpiod_put_array(struct gpio_descs *descs);
int gpiod_set_array_value(unsigned int array_size,
@@ -204,11 +209,6 @@ static inline int gpiod_set_consumer_name(struct gpio_desc *desc,
return -EINVAL;
}
-static inline int gpiod_count(struct device *dev, const char *con_id)
-{
- return 0;
-}
-
static inline void gpiod_put_array(struct gpio_descs *descs)
{
/* GPIO can never have been requested */
--
2.39.5
More information about the barebox
mailing list