aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-01-24 13:55:22 +0100
committerLinus Walleij <linus.walleij@linaro.org>2018-03-19 01:50:07 +0100
commit1cb6610aec83a592ca04d92d6a4fadaee5611e44 (patch)
treefb70e29058675fe8b0b9981802d63efa4becc01e /drivers/gpio
parentMerge tag 'v4.16-rc5' into devel (diff)
downloadlinux-dev-1cb6610aec83a592ca04d92d6a4fadaee5611e44.tar.xz
linux-dev-1cb6610aec83a592ca04d92d6a4fadaee5611e44.zip
gpio: dln2: Include proper header
This driver has no business including <linux/gpio.h>, it is a driver so include <linux/gpio/driver.h>. GPIOF_DIR_IN/GPIOF_DIR_OUT are for consumers and should not be used in drivers to use just 1/0 instead. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-dln2.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c
index 1dada68b9a27..c4e7953c093e 100644
--- a/drivers/gpio/gpio-dln2.c
+++ b/drivers/gpio/gpio-dln2.c
@@ -15,7 +15,6 @@
#include <linux/irqdomain.h>
#include <linux/irq.h>
#include <linux/irqchip/chained_irq.h>
-#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include <linux/platform_device.h>
#include <linux/mfd/dln2.h>
@@ -204,9 +203,9 @@ static int dln2_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
struct dln2_gpio *dln2 = gpiochip_get_data(chip);
if (test_bit(offset, dln2->output_enabled))
- return GPIOF_DIR_OUT;
+ return 0;
- return GPIOF_DIR_IN;
+ return 1;
}
static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset)
@@ -218,7 +217,7 @@ static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset)
if (dir < 0)
return dir;
- if (dir == GPIOF_DIR_IN)
+ if (dir == 1)
return dln2_gpio_pin_get_in_val(dln2, offset);
return dln2_gpio_pin_get_out_val(dln2, offset);