Skip to contentSkip to conversation

Staging: iio: adt7316: use correct headers for gpio

PATCH In review Arnd Bergmann 2 participants 2 messages Jun 17, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: iio: adt7316: use correct headers for gpio

When building without CONFIG_GPIOLIB, we get a compile-time failure:

drivers/staging/iio/addac/adt7316.c:947:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration]

                gpiod_set_value(chip->ldac_pin, 0);
                ^
drivers/staging/iio/addac/adt7316.c:947:3: note: did you mean 'gpio_set_value'?
include/linux/gpio.h:169:20: note: 'gpio_set_value' declared here
static inline void gpio_set_value(unsigned gpio, int value)
                   ^
drivers/staging/iio/addac/adt7316.c:947:3: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
                gpiod_set_value(chip->ldac_pin, 0);
                ^
drivers/staging/iio/addac/adt7316.c:1805:13: error: implicit declaration of function 'irqd_get_trigger_type' [-Werror,-Wimplicit-function-declaration]
        irq_type = irqd_get_trigger_type(irq_get_irq_data(chip->bus.irq));

Include the correct headers that contain the declarations for these functions.

Fixes c63460c4298f ("Staging: iio: adt7316: Use device tree data to set ldac_pin")
---
 drivers/staging/iio/addac/adt7316.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/addac/adt7316.c +2 -1
index 37ce563cb0e1..9cb3d0e42c38 100644
@@ -6,7 +6,8 @@
  */
 
 #include <linux/interrupt.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
+#include <linux/irq.h>
 #include <linux/workqueue.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
Signature · 1 line
2.20.0
maintainer
#1 lore raw
Quoted 15 lines · On Mon, 17 Jun 2019 13:09:20 +0200 Arnd Bergmann <[email protected]> wrote:

When building without CONFIG_GPIOLIB, we get a compile-time failure:

drivers/staging/iio/addac/adt7316.c:947:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration]

                gpiod_set_value(chip->ldac_pin, 0);
                ^
drivers/staging/iio/addac/adt7316.c:947:3: note: did you mean 'gpio_set_value'?
include/linux/gpio.h:169:20: note: 'gpio_set_value' declared here
static inline void gpio_set_value(unsigned gpio, int value)
                   ^
drivers/staging/iio/addac/adt7316.c:947:3: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
                gpiod_set_value(chip->ldac_pin, 0);
                ^
drivers/staging/iio/addac/adt7316.c:1805:13: error: implicit declaration of function 'irqd_get_trigger_type' [-Werror,-Wimplicit-function-declaration]
        irq_type = irqd_get_trigger_type(irq_get_irq_data(chip->bus.irq));
Quoted 5 lines

Include the correct headers that contain the declarations for these functions.

Fixes c63460c4298f ("Staging: iio: adt7316: Use device tree data to set ldac_pin")

Sorry, this is me being exceedingly slow on getting the fix upstream.

I've just sent a pull request for the fix I've had queued up for a few weeks.

Jonathan

Quoted 18 lines
---
 drivers/staging/iio/addac/adt7316.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/addac/adt7316.c +2 -1
index 37ce563cb0e1..9cb3d0e42c38 100644
@@ -6,7 +6,8 @@
  */
 
 #include <linux/interrupt.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
+#include <linux/irq.h>
 #include <linux/workqueue.h>
 #include <linux/device.h>
 #include <linux/kernel.h>