summaryrefslogtreecommitdiffstats
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
parentpinctrl: clarify some dt pinconfig options (diff)
downloadlinux-e4a8844c04c00a1a64c6779692e1baff3851c1f7.tar.xz
linux-e4a8844c04c00a1a64c6779692e1baff3851c1f7.zip
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.