aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-10-03 16:15:20 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-03 16:15:20 -0400
commite8184a47c9cc04380553114815356d1042a27788 (patch)
treea3c57da94c37eedf7cafdff86e2065dc5837f557 /drivers/sh
parent872f36a69fea9763f000ec1bc7a5282e43b67b96 (diff)
sh: pfc: Fix up BUG() triggered by gpiolib debugfs lookups.
The gpiolib debugfs entry takes a hammer approach and iterates over all of the potential GPIOs, regardless of their type. The SH PFC code on the other hand contains a variable mismash of input/output/function types spread out sparsely, leading to situations where the debug code can trigger an out of range enum for the type. Since we already have an error path for out of range enums, we can just hand that up to the higher level instead of the current BUG() behaviour. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/pfc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
index dee581f6382c..75934e3ea34e 100644
--- a/drivers/sh/pfc.c
+++ b/drivers/sh/pfc.c
@@ -561,10 +561,8 @@ static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
561 struct pinmux_data_reg *dr = NULL; 561 struct pinmux_data_reg *dr = NULL;
562 int bit = 0; 562 int bit = 0;
563 563
564 if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0) { 564 if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
565 BUG(); 565 return -EINVAL;
566 return 0;
567 }
568 566
569 return gpio_read_reg(dr->reg, dr->reg_width, 1, bit); 567 return gpio_read_reg(dr->reg, dr->reg_width, 1, bit);
570} 568}