iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name
[firefly-linux-kernel-4.4.55.git] / drivers / iio / inkern.c
index c7497009d60ab7b81358b85d9ecd4057642276e7..f0846108d0067b4a979f3c3b86624b6e211cfa76 100644 (file)
@@ -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",