linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Tull <atull@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Hoan Tran <hotran@apm.com>
Subject: Re: [PATCH] gpio: dwapb: fix bgpio usage
Date: Tue, 24 Oct 2017 15:22:56 -0500	[thread overview]
Message-ID: <CANk1AXTVdTeo6LtCHdK-XeRqkyccru4xKaFndoOasa7WpyB+0Q@mail.gmail.com> (raw)
In-Reply-To: <20171020102951.6305-1-linus.walleij@linaro.org>

On Fri, Oct 20, 2017 at 5:29 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> The DW APB GPIO driver uses the generic GPIO library gpio-mmio,
> and initialize the flags as "false", which should be 0.
>
> When no flags are given, the native endianness is used to access
> the MMIO registers, and the pin2mask() call can simply be
> converted to a BIT() call, as per the default pin2mask()
> implementation in gpio-mmio.c.
>
> Cc: Hoan Tran <hotran@apm.com>
> Cc: Alan Tull <atull@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Alan Tull <atull@kernel.org>

> ---
>  drivers/gpio/gpio-dwapb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index d782ad195c89..6730c6642ce3 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -320,7 +320,7 @@ static int dwapb_gpio_set_debounce(struct gpio_chip *gc,
>         struct dwapb_gpio_port *port = gpiochip_get_data(gc);
>         struct dwapb_gpio *gpio = port->gpio;
>         unsigned long flags, val_deb;
> -       unsigned long mask = gc->pin2mask(gc, offset);
> +       unsigned long mask = BIT(offset);
>
>         spin_lock_irqsave(&gc->bgpio_lock, flags);
>
> @@ -482,7 +482,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
>                 (pp->idx * GPIO_SWPORT_DDR_SIZE);
>
>         err = bgpio_init(&port->gc, gpio->dev, 4, dat, set, NULL, dirout,
> -                        NULL, false);
> +                        NULL, 0);
>         if (err) {
>                 dev_err(gpio->dev, "failed to init gpio chip for port%d\n",
>                         port->idx);
> --
> 2.13.6
>

  reply	other threads:[~2017-10-24 20:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 10:29 [PATCH] gpio: dwapb: fix bgpio usage Linus Walleij
2017-10-24 20:22 ` Alan Tull [this message]
2017-10-24 20:26 ` Hoan Tran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANk1AXTVdTeo6LtCHdK-XeRqkyccru4xKaFndoOasa7WpyB+0Q@mail.gmail.com \
    --to=atull@kernel.org \
    --cc=hotran@apm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).