[PATCH 3/4] pinctrl: AT91: Only use of_alias_get_id when probed from devicetree

Sascha Hauer s.hauer at pengutronix.de
Mon Sep 8 06:23:41 PDT 2014


If probed from platform data we have to use dev->id instead.

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

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index e212f7a..3c194df 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -618,10 +618,15 @@ static int at91_gpio_probe(struct device_d *dev)
 	struct at91_gpio_chip *at91_gpio;
 	struct clk *clk;
 	int ret;
-	int alias_idx = of_alias_get_id(dev->device_node, "gpio");
+	int alias_idx;
 
 	BUG_ON(dev->id > MAX_GPIO_BANKS);
 
+	if (dev->device_node)
+		alias_idx = of_alias_get_id(dev->device_node, "gpio");
+	else
+		alias_idx = dev->id;
+
 	at91_gpio = &gpio_chip[alias_idx];
 
 	clk = clk_get(dev, NULL);
-- 
2.1.0




More information about the barebox mailing list