Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+3 -4
+3 -4
drivers/gpio/gpio-dln2.c
··· 15 15 #include <linux/irqdomain.h> 16 16 #include <linux/irq.h> 17 17 #include <linux/irqchip/chained_irq.h> 18 - #include <linux/gpio.h> 19 18 #include <linux/gpio/driver.h> 20 19 #include <linux/platform_device.h> 21 20 #include <linux/mfd/dln2.h> ··· 203 204 struct dln2_gpio *dln2 = gpiochip_get_data(chip); 204 205 205 206 if (test_bit(offset, dln2->output_enabled)) 206 - return GPIOF_DIR_OUT; 207 + return 0; 207 208 208 - return GPIOF_DIR_IN; 209 + return 1; 209 210 } 210 211 211 212 static int dln2_gpio_get(struct gpio_chip *chip, unsigned int offset) ··· 217 218 if (dir < 0) 218 219 return dir; 219 220 220 - if (dir == GPIOF_DIR_IN) 221 + if (dir == 1) 221 222 return dln2_gpio_pin_get_in_val(dln2, offset); 222 223 223 224 return dln2_gpio_pin_get_out_val(dln2, offset);