diff mbox

[PATCH/RFC,181/390] sh: pfc: Ignore pinmux GPIOs with invalid enum IDs.

Message ID 1364525119-31791-182-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman March 29, 2013, 2:41 a.m. UTC
From: Paul Mundt <lethal@linux-sh.org>

If we encounter invalid entries in the pinmux GPIO range, make sure we've
still got a dummy pin definition but don't otherwise map it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
(cherry picked from commit e3e79454a7c81a5e48c6d6b31068b12936e7d780)

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 drivers/sh/pfc/pinctrl.c |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c
index 4eaf24b..e79e379 100644
--- a/drivers/sh/pfc/pinctrl.c
+++ b/drivers/sh/pfc/pinctrl.c
@@ -338,6 +338,10 @@  static int __devinit sh_pfc_map_gpios(struct sh_pfc *pfc,
 		pin->number = pfc->first_gpio + i;
 		pin->name = gpio->name;
 
+		/* XXX */
+		if (unlikely(!gpio->enum_id))
+			continue;
+
 		sh_pfc_map_one_gpio(pfc, pmx, gpio, i);
 	}