pinctrl: pinctrl_select_state: set the old_state back on error
authorRichard Genoud <richard.genoud@gmail.com>
Thu, 28 Mar 2013 11:55:48 +0000 (12:55 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 3 Apr 2013 12:27:31 +0000 (14:27 +0200)
In unapply_new_state, the old state is re-applied, but p->state is not
set back as it should.

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>
drivers/pinctrl/core.c

index f04f7d3d9a94beeee96f9cd791db3cf48b077b16..96cee791aa829b10e97c527d8fcfeeae8daee383 100644 (file)
@@ -991,6 +991,8 @@ unapply_new_state:
                                pinmux_enable_setting(setting);
                }
        }
+
+       p->state = old_state;
        return ret;
 }