diff mbox series

[v1,3/9] pinctrl: baytrail: Remove unneeded linux/gpio.h inclusion

Message ID 20180904112625.8630-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/9] pinctrl: intel: Move linux/pm.h to the local header | expand

Commit Message

Andy Shevchenko Sept. 4, 2018, 11:26 a.m. UTC
This driver has no business including <linux/gpio.h>, it is a driver.

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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-baytrail.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mika Westerberg Sept. 6, 2018, 11:22 a.m. UTC | #1
On Tue, Sep 04, 2018 at 02:26:19PM +0300, Andy Shevchenko wrote:
> This driver has no business including <linux/gpio.h>, it is a driver.
> 
> 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Linus Walleij Sept. 18, 2018, 10:16 p.m. UTC | #2
On Tue, Sep 4, 2018 at 4:26 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> This driver has no business including <linux/gpio.h>, it is a driver.
>
> 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Ooops applied a similar big patch in parallel.
Had to drop this one. The result should be the same.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index 1e0c11184597..0e41e99fff25 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -11,7 +11,6 @@ 
 #include <linux/types.h>
 #include <linux/bitops.h>
 #include <linux/interrupt.h>
-#include <linux/gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/acpi.h>
 #include <linux/platform_device.h>
@@ -1360,9 +1359,9 @@  static int byt_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
 	raw_spin_unlock_irqrestore(&vg->lock, flags);
 
 	if (!(value & BYT_OUTPUT_EN))
-		return GPIOF_DIR_OUT;
+		return 0;
 	if (!(value & BYT_INPUT_EN))
-		return GPIOF_DIR_IN;
+		return 1;
 
 	return -EINVAL;
 }