From: Heiko Stübner Date: Fri, 14 Jun 2013 15:43:21 +0000 (+0200) Subject: pinctrl: handle zero found dt pinconfig properties better X-Git-Tag: v3.11-rc1~111^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4a8844c04c00a1a64c6779692e1baff3851c1f7;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Signed-off-by: Heiko Stuebner Reviewed-by: James Hogan Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index dcf0371..ea9da17 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.