Skip to content

Commit

Permalink
pinctrl: handle zero found dt pinconfig properties better
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiko Stübner authored and Linus Walleij committed Jun 17, 2013
1 parent 9ee1f7d commit e4a8844
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/pinctrl/pinconf-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e4a8844

Please sign in to comment.