Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name

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>
Cc: Stable@vger.kernel.org

authored by

Johannes Pointner and committed by
Jonathan Cameron
872687f6 eb29835f

+1 -1
+1 -1
drivers/iio/inkern.c
··· 178 178 index = of_property_match_string(np, "io-channel-names", 179 179 name); 180 180 chan = of_iio_channel_get(np, index); 181 - if (!IS_ERR(chan)) 181 + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) 182 182 break; 183 183 else if (name && index >= 0) { 184 184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",