diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2013-03-29 05:03:26 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-04-03 08:36:43 -0400 |
commit | af6061777131639d7d2687ce542b6052a6510c25 (patch) | |
tree | 20ec7d1b588956f6fd7aa8706339af91351941b2 | |
parent | 28d0c14b43a04deac8afe27ab700cc7638a7f4ba (diff) |
pinctrl: select_state: don't call pinctrl_free_setting on error
As Stephen Warren pointed out, pinctrl_free_setting() was called instead
of pinmux_disable_setting() on error.
In this error code, we want to call pinmux_disable_setting() where
pinmux_enable_setting() was called.
And when pinconf_apply_setting() was called, we can't do much to undo
the pin muxing (the closest thing I can think about for "unmuxing" a pin
is muxing it as GPIO input).
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 96cee791aa82..deb3d04323b0 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -970,7 +970,15 @@ unapply_new_state: | |||
970 | list_for_each_entry(setting2, &state->settings, node) { | 970 | list_for_each_entry(setting2, &state->settings, node) { |
971 | if (&setting2->node == &setting->node) | 971 | if (&setting2->node == &setting->node) |
972 | break; | 972 | break; |
973 | pinctrl_free_setting(true, setting2); | 973 | /* |
974 | * All we can do here is pinmux_disable_setting. | ||
975 | * That means that some pins are muxed differently now | ||
976 | * than they were before applying the setting (We can't | ||
977 | * "unmux a pin"!), but it's not a big deal since the pins | ||
978 | * are free to be muxed by another apply_setting. | ||
979 | */ | ||
980 | if (setting2->type == PIN_MAP_TYPE_MUX_GROUP) | ||
981 | pinmux_disable_setting(setting2); | ||
974 | } | 982 | } |
975 | 983 | ||
976 | if (old_state) { | 984 | if (old_state) { |