Skip to contentSkip to conversation

staging: iio: adt7316: Fix build errors when GPIOLIB is not set

PATCH Superseded Fabio Estevam 2 participants 3 messages Jun 6, 2019

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: iio: adt7316: Fix build errors when GPIOLIB is not set

On x86_64 when GPIOLIB is not set the following build errors are seen:

drivers/staging/iio/addac/adt7316.c:947:3: error: implicit declaration of function 'gpiod_set_value' [-Werror=implicit-function-declaration] drivers/staging/iio/addac/adt7316.c:1805:2: error: implicit declaration of function 'irqd_get_trigger_type' [-Werror=implicit-function-declaration]

These functions are provided by the <linux/gpio/consumer.h> and <linux/irq.h> headers, so include them to fix these build errors.

---
 drivers/staging/iio/addac/adt7316.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/iio/addac/adt7316.c +2 -0
index 37ce563cb0e1..5470a9c3f872 100644
@@ -7,6 +7,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.17.1
#1 lore raw

G'day Fabio,

Quoted 21 lines · Fabio Estevam

On x86_64 when GPIOLIB is not set the following build errors are seen:

drivers/staging/iio/addac/adt7316.c:947:3: error: implicit declaration of function 'gpiod_set_value' [-Werror=implicit-function-declaration] drivers/staging/iio/addac/adt7316.c:1805:2: error: implicit declaration of function 'irqd_get_trigger_type' [-Werror=implicit-function-declaration]

These functions are provided by the <linux/gpio/consumer.h> and <linux/irq.h> headers, so include them to fix these build errors.

---
  drivers/staging/iio/addac/adt7316.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/staging/iio/addac/adt7316.c +0 -0
index 37ce563cb0e1..5470a9c3f872 100644

drivers/staging/iio/addac/adt7316.c line 9

Quoted 3 lines
drivers/staging/iio/addac/adt7316.c +0 -0
@@ -7,6 +7,8 @@
 
  #include <linux/interrupt.h>
  #include <linux/gpio.h>

This should be removed as well.
See comment at top of linux/gpio.h

Quoted 6 lines
drivers/staging/iio/addac/adt7316.c +2 -0
+#include <linux/gpio/consumer.h>
+#include <linux/irq.h>
  #include <linux/workqueue.h>
  #include <linux/device.h>
  #include <linux/kernel.h>
Signature · 2 lines
Regards
Phil Reid
#2 lore raw

Hi Phil,

Quoted 3 lines · Phil Reid
Quoted 1 line
  #include <linux/gpio.h>

This should be removed as well.
See comment at top of linux/gpio.h

Good catch! Just sent a v2.

Thanks