Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / pinctrl / core.c
index e09474ecde2346bd900d8f9d05ba3c26c63f9aa9..e4f65510c87e8928666e195b6b76e52cae9252b5 100644 (file)
@@ -992,29 +992,15 @@ int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *state)
 
        if (p->state) {
                /*
-                * The set of groups with a mux configuration in the old state
-                * may not be identical to the set of groups with a mux setting
-                * in the new state. While this might be unusual, it's entirely
-                * possible for the "user"-supplied mapping table to be written
-                * that way. For each group that was configured in the old state
-                * but not in the new state, this code puts that group into a
-                * safe/disabled state.
+                * For each pinmux setting in the old state, forget SW's record
+                * of mux owner for that pingroup. Any pingroups which are
+                * still owned by the new state will be re-acquired by the call
+                * to pinmux_enable_setting() in the loop below.
                 */
                list_for_each_entry(setting, &p->state->settings, node) {
-                       bool found = false;
                        if (setting->type != PIN_MAP_TYPE_MUX_GROUP)
                                continue;
-                       list_for_each_entry(setting2, &state->settings, node) {
-                               if (setting2->type != PIN_MAP_TYPE_MUX_GROUP)
-                                       continue;
-                               if (setting2->data.mux.group ==
-                                               setting->data.mux.group) {
-                                       found = true;
-                                       break;
-                               }
-                       }
-                       if (!found)
-                               pinmux_disable_setting(setting);
+                       pinmux_disable_setting(setting);
                }
        }