mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] pinctrl: AT91: use alias_idx to calculate the base gpio number
Date: Mon,  8 Sep 2014 15:23:42 +0200	[thread overview]
Message-ID: <1410182622-22876-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1410182622-22876-1-git-send-email-s.hauer@pengutronix.de>

For the devicetree case alias_idx contains the gpio bank number.
dev->id has no meaning in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/pinctrl/pinctrl-at91.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 3c194df..e77c8c4 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -651,7 +651,7 @@ static int at91_gpio_probe(struct device_d *dev)
 	at91_gpio->chip.ops = &at91_gpio_ops;
 	at91_gpio->chip.ngpio = MAX_NB_GPIO_PER_BANK;
 	at91_gpio->chip.dev = dev;
-	at91_gpio->chip.base = dev->id * MAX_NB_GPIO_PER_BANK;
+	at91_gpio->chip.base = alias_idx * MAX_NB_GPIO_PER_BANK;
 
 	ret = gpiochip_add(&at91_gpio->chip);
 	if (ret) {
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-09-08 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 13:23 AT91 pinctrl/gpio fixes Sascha Hauer
2014-09-08 13:23 ` [PATCH 1/4] ARM: AT91: Add missing include Sascha Hauer
2014-09-08 13:23 ` [PATCH 2/4] ARM: AT91: Make gpio mux functions inline Sascha Hauer
2014-09-08 13:23 ` [PATCH 3/4] pinctrl: AT91: Only use of_alias_get_id when probed from devicetree Sascha Hauer
2014-09-08 13:23 ` Sascha Hauer [this message]
2014-09-08 13:36 ` AT91 pinctrl/gpio fixes Raphaël Poggi
2014-09-09  8:19   ` Sascha Hauer
2014-09-09  8:47     ` Raphaël Poggi

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=1410182622-22876-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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