pinctrl: propagate map validation errors
authorStephen Warren <swarren@nvidia.com>
Wed, 25 Apr 2012 16:32:16 +0000 (10:32 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 26 Apr 2012 08:49:28 +0000 (10:49 +0200)
pinctrl_register_map() was returning early if pinmux_validate_map() or
pinconf_validate_map() failed, but was not actually returning the error
code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c

index 5cd5a5a3a403c27658ce39f73056bace6dba1b0e..913c83e2bf1c53c9126b960ae8ee0bdcfbe56191 100644 (file)
@@ -911,13 +911,13 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
                case PIN_MAP_TYPE_MUX_GROUP:
                        ret = pinmux_validate_map(&maps[i], i);
                        if (ret < 0)
-                               return 0;
+                               return ret;
                        break;
                case PIN_MAP_TYPE_CONFIGS_PIN:
                case PIN_MAP_TYPE_CONFIGS_GROUP:
                        ret = pinconf_validate_map(&maps[i], i);
                        if (ret < 0)
-                               return 0;
+                               return ret;
                        break;
                default:
                        pr_err("failed to register map %s (%d): invalid type given\n",