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>
This commit is contained in:
Heiko Stübner 2013-06-14 17:43:21 +02:00 коммит произвёл Linus Walleij
Родитель 9ee1f7d266
Коммит e4a8844c04
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -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.