diff options
author | Florian Vaussard <florian.vaussard@epfl.ch> | 2014-02-05 01:51:22 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-02-06 07:48:17 -0500 |
commit | e7f2a444891cb39f11d5429467d0fd7e011fe7fe (patch) | |
tree | 502ef3bb1342dc7b23553684b12103188c367639 /drivers/pinctrl | |
parent | 7b320cb1ed2dbd2c5f2a778197baf76fd6bf545a (diff) |
pinctrl: do not init debugfs entries for unimplemented functionalities
Commit c420619 "pinctrl: pinconf: remove checks on ops->pin_config_get"
removed the check on (ops != NULL) when performing pinconf_pins_show() or
pinconf_groups_show(). As these entries are always enabled, even if
pinconf is not supported, reading will result in an oops due to NULL
ops.
Instead of checking for ops, remove the corresponding debugfs entries if
pinconf and/or pinmux are not implemented.
Tested on OMAP3 (pinctrl-single).
Cc: stable@vger.kernel.org
Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index cab020a58bf5..c0fe6091566a 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -1644,8 +1644,10 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) | |||
1644 | device_root, pctldev, &pinctrl_groups_ops); | 1644 | device_root, pctldev, &pinctrl_groups_ops); |
1645 | debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, | 1645 | debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, |
1646 | device_root, pctldev, &pinctrl_gpioranges_ops); | 1646 | device_root, pctldev, &pinctrl_gpioranges_ops); |
1647 | pinmux_init_device_debugfs(device_root, pctldev); | 1647 | if (pctldev->desc->pmxops) |
1648 | pinconf_init_device_debugfs(device_root, pctldev); | 1648 | pinmux_init_device_debugfs(device_root, pctldev); |
1649 | if (pctldev->desc->confops) | ||
1650 | pinconf_init_device_debugfs(device_root, pctldev); | ||
1649 | } | 1651 | } |
1650 | 1652 | ||
1651 | static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) | 1653 | static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) |