]> git.karo-electronics.de Git - linux-beck.git/commitdiff
pinctrl: a minor error checking improvement for pinconf
authorDong Aisheng <dong.aisheng@linaro.org>
Mon, 14 May 2012 11:06:36 +0000 (19:06 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 15 May 2012 07:43:18 +0000 (09:43 +0200)
Also checking invalid num_configs when validate the pinconf map.

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/pinconf.c

index 7ce139ef7e64b39d64518d164f20de80442b857c..43f474cdc11082717c881b757c6bcaf104bcbb97 100644 (file)
@@ -50,9 +50,9 @@ int pinconf_validate_map(struct pinctrl_map const *map, int i)
                return -EINVAL;
        }
 
-       if (map->data.configs.num_configs &&
+       if (!map->data.configs.num_configs ||
                        !map->data.configs.configs) {
-               pr_err("failed to register map %s (%d): no configs ptr given\n",
+               pr_err("failed to register map %s (%d): no configs given\n",
                       map->name, i);
                return -EINVAL;
        }