summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinconf-generic.c
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-06-14 17:43:21 +0200
committerLinus Walleij <linus.walleij@linaro.org>2013-06-17 18:18:31 +0200
commite4a8844c04c00a1a64c6779692e1baff3851c1f7 (patch)
tree3ba79a4fd0c9813749b555f680d0fbc7a36f94e6 /drivers/pinctrl/pinconf-generic.c
parent9ee1f7d266aa1e2bfeb20cb5d4ac299c8e8ef8c7 (diff)
downloadlinux-next-e4a8844c04c00a1a64c6779692e1baff3851c1f7.tar.gz
pinctrl: handle zero found dt pinconfig properties better
This adds a shortcut when no valid pinconf properties are found in the parsed dt node, to set the values immediately and return. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinconf-generic.c')
-rw-r--r--drivers/pinctrl/pinconf-generic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index dcf03714de90..ea9da1752252 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -208,6 +208,13 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
ncfg++;
}
+ /* no configs found at all */
+ if (ncfg == 0) {
+ *configs = NULL;
+ *nconfigs = 0;
+ return 0;
+ }
+
/*
* Now limit the number of configs to the real number of
* found properties.