linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Barry Song <baohua@kernel.org>,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
Date: Mon, 31 Jul 2017 12:58:10 +0200	[thread overview]
Message-ID: <20170731105810.GI26667@ulmo> (raw)
In-Reply-To: <20170720170107.14612-1-thierry.reding@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

On Thu, Jul 20, 2017 at 07:01:07PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The GPIO offset is never initialized, which means that it will end up
> being zero as per the devm_kzalloc() of the parent structure.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> I have no idea how the driver could've ever worked for anything other
> than instances with a single bank, but maybe it did and I missed some
> detail.
> 
>  drivers/pinctrl/sirf/pinctrl-atlas7.c | 1 +
>  1 file changed, 1 insertion(+)

Any comments on this one?

Thierry

> 
> diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> index 36b5c8d5471e..a2ca4a9472c7 100644
> --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
> +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
> @@ -6078,6 +6078,7 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
>  		bank = &a7gc->banks[idx];
>  		/* Set ctrl registers' base of this bank */
>  		bank->base = ATLAS7_GPIO_BASE(a7gc, idx);
> +		bank->gpio_offset = idx * NGPIO_OF_BANK;
>  
>  		/* Get interrupt number from DTS */
>  		ret = of_irq_get(np, idx);
> -- 
> 2.13.3
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-07-31 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 17:01 [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset Thierry Reding
2017-07-31 10:58 ` Thierry Reding [this message]
2017-08-02 12:25 ` Linus Walleij

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=20170731105810.GI26667@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=baohua@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).