diff mbox series

[v2] gpio: tegra: Include the right header

Message ID 20180806230439.32748-1-linus.walleij@linaro.org
State New
Headers show
Series [v2] gpio: tegra: Include the right header | expand

Commit Message

Linus Walleij Aug. 6, 2018, 11:04 p.m. UTC
This is a GPIO driver so include only <linux/gpio/driver.h>.
Drop the use of GPIOF_* flags: these are for consumers, not
drivers. Just return 0/1.

Cc: Stefan Agner <stefan@agner.ch>
Cc: Dmitry Osipenko <digetx@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Also get rid of GPIOF_* usage
---
 drivers/gpio/gpio-tegra.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dmitry Osipenko Aug. 7, 2018, 2:08 a.m. UTC | #1
On Tuesday 07 August 2018 02:04:39 Linus Walleij wrote:
> This is a GPIO driver so include only <linux/gpio/driver.h>.
> Drop the use of GPIOF_* flags: these are for consumers, not
> drivers. Just return 0/1.
>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Dmitry Osipenko <digetx@gmail.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Also get rid of GPIOF_* usage
> ---
>  drivers/gpio/gpio-tegra.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
> index 2d940785bad0..8e5f3150c6af 100644
> --- a/drivers/gpio/gpio-tegra.c
> +++ b/drivers/gpio/gpio-tegra.c
> @@ -22,7 +22,7 @@
>  #include <linux/irq.h>
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/driver.h>
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/module.h>
> @@ -207,7 +207,7 @@ static int tegra_gpio_get_direction(struct gpio_chip
> *chip,
>
>  	oe = tegra_gpio_readl(tgi, GPIO_OE(tgi, offset));
>
> -	return (oe & pin_mask) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
> +	return !(oe & pin_mask);
>  }
>
>  static int tegra_gpio_set_debounce(struct gpio_chip *chip, unsigned int
> offset,

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 2d940785bad0..8e5f3150c6af 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -22,7 +22,7 @@ 
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/gpio.h>
+#include <linux/gpio/driver.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/module.h>
@@ -207,7 +207,7 @@  static int tegra_gpio_get_direction(struct gpio_chip *chip,
 
 	oe = tegra_gpio_readl(tgi, GPIO_OE(tgi, offset));
 
-	return (oe & pin_mask) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
+	return !(oe & pin_mask);
 }
 
 static int tegra_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset,