aboutsummaryrefslogtreecommitdiff
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2013-06-14 17:43:21 +0200
committerMark Brown <broonie@linaro.org>2014-04-04 16:20:40 +0100
commit374b02f771b24b9f4207d6b1c87564968c2615f9 (patch)
tree2b692b448c7b0195d10c23e0bfe65fd874f12059 /drivers/pinctrl
parent255b8fa40a5d04f129acbde59d8c4d9b99bcc096 (diff)
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> (cherry picked from commit e4a8844c04c00a1a64c6779692e1baff3851c1f7) Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-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.