All of lore.kernel.org
 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: [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
Date: Thu, 20 Jul 2017 19:01:07 +0200	[thread overview]
Message-ID: <20170720170107.14612-1-thierry.reding@gmail.com> (raw)

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(+)

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


WARNING: multiple messages have this Message-ID (diff)
From: thierry.reding@gmail.com (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset
Date: Thu, 20 Jul 2017 19:01:07 +0200	[thread overview]
Message-ID: <20170720170107.14612-1-thierry.reding@gmail.com> (raw)

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(+)

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

             reply	other threads:[~2017-07-20 17:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 17:01 Thierry Reding [this message]
2017-07-20 17:01 ` [PATCH] pinctrl: sirf: atlas7: Initialize GPIO offset Thierry Reding
2017-07-31 10:58 ` Thierry Reding
2017-07-31 10:58   ` Thierry Reding
2017-08-02 12:25 ` Linus Walleij
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=20170720170107.14612-1-thierry.reding@gmail.com \
    --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 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.