From e978099cb6156018068101a60b3c6478b341ee20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Heiko=20St=C3=BCbner?= Date: Fri, 14 Jun 2013 17:43:21 +0200 Subject: [PATCH] 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 --- drivers/pinctrl/pinconf-generic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 807ffb4c361e..f6e6ea1b7643 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -204,6 +204,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. -- 2.34.1