pinctrl: make pinmux disable function optional
authorDong Aisheng <dong.aisheng@linaro.org>
Mon, 14 May 2012 11:06:37 +0000 (19:06 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 15 May 2012 07:44:50 +0000 (09:44 +0200)
Some SoCs may not have pinmux disable function in HW.

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

index 220fa492c9f018508ee3be50c231bf9e6e4c4762..3d5ac73bd5a7f978534a315b028e904433c0279b 100644 (file)
@@ -41,8 +41,7 @@ int pinmux_check_ops(struct pinctrl_dev *pctldev)
            !ops->get_functions_count ||
            !ops->get_function_name ||
            !ops->get_function_groups ||
-           !ops->enable ||
-           !ops->disable) {
+           !ops->enable) {
                dev_err(pctldev->dev, "pinmux ops lacks necessary functions\n");
                return -EINVAL;
        }
@@ -497,7 +496,8 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
                desc->mux_setting = NULL;
        }
 
-       ops->disable(pctldev, setting->data.mux.func, setting->data.mux.group);
+       if (ops->disable)
+               ops->disable(pctldev, setting->data.mux.func, setting->data.mux.group);
 }
 
 #ifdef CONFIG_DEBUG_FS