Skip to contentSkip to conversation

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

PATCH Applied Fabio Estevam 3 participants 3 messages Jun 6, 2019 – Jun 8, 2019

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

PATCH v2 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.

While at it, remove <linux/gpio.h> as this driver is a GPIO consumer and not a GPIO driver.

---
Changes since v1:
- Remove <linux/gpio.h> - Phil

 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.17.1
Acked-by on v2 1/1
#1 lore raw
Quoted 10 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.

Quoted 5 lines

While at it, remove <linux/gpio.h> as this driver is a GPIO consumer and not a GPIO driver.

Thanks.

Quoted 22 lines

---
Changes since v1:
- Remove <linux/gpio.h> - Phil

 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
~Randy
maintainer Applied
#2 lore raw
Quoted 11 lines · On Wed, 5 Jun 2019 20:24:09 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 10 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.

Quoted 7 lines
Quoted 5 lines

While at it, remove <linux/gpio.h> as this driver is a GPIO consumer and not a GPIO driver.

Applied to the fixes-togreg branch of iio.git.

thanks,

Jonathan

Quoted 27 lines

Thanks.

Quoted 22 lines

---
Changes since v1:
- Remove <linux/gpio.h> - Phil

 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>