Merge tag 'pinctrl-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[linux-2.6-microblaze.git] / drivers / pinctrl / pinctrl-stmfx.c
index dd5aa9a..9749737 100644 (file)
@@ -296,29 +296,29 @@ static int stmfx_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
                switch (param) {
                case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
                case PIN_CONFIG_BIAS_DISABLE:
+               case PIN_CONFIG_DRIVE_PUSH_PULL:
+                       ret = stmfx_pinconf_set_type(pctl, pin, 0);
+                       if (ret)
+                               return ret;
+                       break;
                case PIN_CONFIG_BIAS_PULL_DOWN:
+                       ret = stmfx_pinconf_set_type(pctl, pin, 1);
+                       if (ret)
+                               return ret;
                        ret = stmfx_pinconf_set_pupd(pctl, pin, 0);
                        if (ret)
                                return ret;
                        break;
                case PIN_CONFIG_BIAS_PULL_UP:
-                       ret = stmfx_pinconf_set_pupd(pctl, pin, 1);
+                       ret = stmfx_pinconf_set_type(pctl, pin, 1);
                        if (ret)
                                return ret;
-                       break;
-               case PIN_CONFIG_DRIVE_OPEN_DRAIN:
-                       if (!dir)
-                               ret = stmfx_pinconf_set_type(pctl, pin, 1);
-                       else
-                               ret = stmfx_pinconf_set_type(pctl, pin, 0);
+                       ret = stmfx_pinconf_set_pupd(pctl, pin, 1);
                        if (ret)
                                return ret;
                        break;
-               case PIN_CONFIG_DRIVE_PUSH_PULL:
-                       if (!dir)
-                               ret = stmfx_pinconf_set_type(pctl, pin, 0);
-                       else
-                               ret = stmfx_pinconf_set_type(pctl, pin, 1);
+               case PIN_CONFIG_DRIVE_OPEN_DRAIN:
+                       ret = stmfx_pinconf_set_type(pctl, pin, 1);
                        if (ret)
                                return ret;
                        break;
@@ -620,10 +620,8 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               dev_err(pctl->dev, "failed to get irq\n");
+       if (irq <= 0)
                return -ENXIO;
-       }
 
        mutex_init(&pctl->lock);