All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] gpio: merrifield: Don't use GPIOF_DIR_IN / GPIOF_DIR_OUT
@ 2017-03-23 12:56 Andy Shevchenko
  2017-03-23 13:06 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-03-23 12:56 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio; +Cc: Andy Shevchenko

The mentioned flags are dedicated solely for consumer API.
Replace them by explicit values.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-merrifield.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index f40088d268c1..96dc5123a58a 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -166,7 +166,7 @@ static int mrfld_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
 {
 	void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
 
-	return (readl(gpdr) & BIT(offset % 32)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
+	return (readl(gpdr) & BIT(offset % 32)) ? 0 : 1;
 }
 
 static int mrfld_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset,
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] gpio: merrifield: Don't use GPIOF_DIR_IN / GPIOF_DIR_OUT
  2017-03-23 12:56 [PATCH v1] gpio: merrifield: Don't use GPIOF_DIR_IN / GPIOF_DIR_OUT Andy Shevchenko
@ 2017-03-23 13:06 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-03-23 13:06 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-gpio

On Thu, Mar 23, 2017 at 1:56 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> The mentioned flags are dedicated solely for consumer API.
> Replace them by explicit values.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-merrifield.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index f40088d268c1..96dc5123a58a 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -166,7 +166,7 @@ static int mrfld_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
>  {
>         void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
>
> -       return (readl(gpdr) & BIT(offset % 32)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
> +       return (readl(gpdr) & BIT(offset % 32)) ? 0 : 1;

I would normally just do this to clamp to [0,1]:

return !(readl(gpdr) & BIT(offset % 32));

So did that fix in the commit.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-23 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 12:56 [PATCH v1] gpio: merrifield: Don't use GPIOF_DIR_IN / GPIOF_DIR_OUT Andy Shevchenko
2017-03-23 13:06 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.