[PATCH] pinctrl: fix error path in pinconf_map_to_setting()

Stephen Warren swarren at wwwdotorg.org
Mon Mar 12 17:04:43 EDT 2012


On 03/12/2012 02:41 PM, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij at linaro.org>
> 
> The code was using the union member
> setting->data.configs.group_or_pin to store a potential
> error code, but since that member is unsigned the
> < 0 comparison was not true, letting errors pass thru,

"thru" is a pet peeve of mine; it'd be great to spell this correctly as
"through".

> ending up as mapped to pin "-22". Fix this up and print
> the error.

Oops. Sorry about that.

> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
...
> -		setting->data.configs.group_or_pin =
> -			pin_get_from_name(pctldev,
> -					  map->data.configs.group_or_pin);
> -		if (setting->data.configs.group_or_pin < 0)
> -			return setting->data.configs.group_or_pin;
> +		ret = pin_get_from_name(pctldev,
> +					map->data.configs.group_or_pin);
> +		if (ret < 0) {

"ret" here is named "pin" other places pin_get_from_name() is called,
and that naming seems to make a bit more sense here too.

Otherwise,
Acked-by: Stephen Warren <swarren at wwwdotorg.org>



More information about the linux-arm-kernel mailing list