diff options
author | Johannes Pointner <johannes.pointner@gmail.com> | 2014-08-25 09:04:00 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-05 14:54:12 -0700 |
commit | db875b8f548c270ddbd8da1dcaa188723027ade3 (patch) | |
tree | 4f78eb4dcc662a66c52ba3068ee78b808c4adf12 | |
parent | 90c5b0fbd466cdff666077aae8626c3ff0a2f2ca (diff) | |
download | lwn-db875b8f548c270ddbd8da1dcaa188723027ade3.tar.gz lwn-db875b8f548c270ddbd8da1dcaa188723027ade3.zip |
iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name
commit 872687f626e033b4ddfaec1e410057cfc6636d77 upstream.
Fixes: a2c12493ed7e ('iio: of_iio_channel_get_by_name() returns non-null pointers for error legs')
which improperly assumes that of_iio_channel_get_by_name must always
return NULL and thus now hides -EPROBE_DEFER.
Signed-off-by: Johannes Pointner <johannes.pointner@br-automation.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/iio/inkern.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 1e8e94d4db7d..4fc88e617acf 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, index = of_property_match_string(np, "io-channel-names", name); chan = of_iio_channel_get(np, index); - if (!IS_ERR(chan)) + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) break; else if (name && index >= 0) { pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |