diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-08 15:30:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-09 22:26:26 +0200 |
commit | 80bfa0b7cbbe9d749bb8df6d432830c9c928f822 (patch) | |
tree | 13f4908446fe522cde6f2ff977870fa7ca1f1af7 | |
parent | 55fb660e0b772553e3303fb48469a32185dc9888 (diff) | |
download | barebox-80bfa0b7cbbe9d749bb8df6d432830c9c928f822.tar.gz barebox-80bfa0b7cbbe9d749bb8df6d432830c9c928f822.tar.xz |
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>
-rw-r--r-- | drivers/of/of_gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/of_gpio.c b/drivers/of/of_gpio.c index 1370d8fe1f..6738a220a5 100644 --- a/drivers/of/of_gpio.c +++ b/drivers/of/of_gpio.c @@ -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]); |