9
0
Fork 0

of_gpio: return error if no device found

of_get_named_gpio_flags used to return 'ret' when no device
is found, but 'ret' is zero here. Return an error instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-04-08 15:30:46 +02:00
parent 55fb660e0b
commit 80bfa0b7cb
1 changed files with 3 additions and 3 deletions

View File

@ -32,9 +32,9 @@ int of_get_named_gpio_flags(struct device_node *np, const char *propname,
dev = of_find_device_by_node(out_args.np);
if (!dev) {
pr_err("%s: unable to find device of node %s: %d\n",
__func__, out_args.np->full_name, ret);
return ret;
pr_err("%s: unable to find device of node %s\n",
__func__, out_args.np->full_name);
return -ENODEV;
}
ret = gpio_get_num(dev, out_args.args[0]);