Skip to content

Commit

Permalink
staging: iio: adt7316: Fix build errors when GPIOLIB is not set
Browse files Browse the repository at this point in the history
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.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Fabio Estevam authored and Jonathan Cameron committed Jun 8, 2019
1 parent 389fc70 commit 767e52f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/staging/iio/addac/adt7316.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 767e52f

Please sign in to comment.