Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 872687f6 authored by Johannes Pointner's avatar Johannes Pointner Committed by Jonathan Cameron
Browse files

iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name



Fixes: a2c12493 ('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: default avatarJohannes Pointner <johannes.pointner@br-automation.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
parent eb29835f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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",
			index = of_property_match_string(np, "io-channel-names",
							 name);
							 name);
		chan = of_iio_channel_get(np, index);
		chan = of_iio_channel_get(np, index);
		if (!IS_ERR(chan))
		if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
			break;
			break;
		else if (name && index >= 0) {
		else if (name && index >= 0) {
			pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
			pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",