diff options
author | Dong Aisheng <dong.aisheng@linaro.org> | 2012-04-10 00:41:34 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-04-18 07:53:11 -0400 |
commit | ad8bb720c23a80233e45ed31d67458f5e5b7ab31 (patch) | |
tree | 6b1da7d3dc99bacd03167a0235785e3f881b03b3 /drivers/pinctrl/pinconf.c | |
parent | a1d31f71e6ed2f714830df8885ec07dfe1f6632e (diff) |
pinctrl: add some error checking for user interfaces
This patch can avoid kernel oops in case the mux or config
function is not supported by driver.
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinconf.c')
-rw-r--r-- | drivers/pinctrl/pinconf.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index eb3a14f4b866..384dcc166e44 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c | |||
@@ -448,8 +448,12 @@ static void pinconf_dump_pin(struct pinctrl_dev *pctldev, | |||
448 | static int pinconf_pins_show(struct seq_file *s, void *what) | 448 | static int pinconf_pins_show(struct seq_file *s, void *what) |
449 | { | 449 | { |
450 | struct pinctrl_dev *pctldev = s->private; | 450 | struct pinctrl_dev *pctldev = s->private; |
451 | const struct pinconf_ops *ops = pctldev->desc->confops; | ||
451 | unsigned i, pin; | 452 | unsigned i, pin; |
452 | 453 | ||
454 | if (!ops || !ops->pin_config_get) | ||
455 | return 0; | ||
456 | |||
453 | seq_puts(s, "Pin config settings per pin\n"); | 457 | seq_puts(s, "Pin config settings per pin\n"); |
454 | seq_puts(s, "Format: pin (name): pinmux setting array\n"); | 458 | seq_puts(s, "Format: pin (name): pinmux setting array\n"); |
455 | 459 | ||