iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name
PATCH 1/1 iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name
Till now of_iio_channel_get_by_name always tried to find the channel without evaluating the return code from of_iio_channel_get. This might include -EPROBE_DEFER in which case the channel is present but its driver simply not probed yet. Therefore simply return on -EPROBE_DEFER so that the driver requesting the channel can also defer.
--- drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/inkern.c +1 -1
@@ -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",
Signature · 1 line
2.0.1
Jonathan Cameron
maintainerQuoted 7 lines · Heiko Stübner
Till now
of_iio_channel_get_by_namealways tried to find the channel without evaluating the return code fromof_iio_channel_get. This might include -EPROBE_DEFER in which case the channel is present but its driver simply not probed yet. Therefore simply return on -EPROBE_DEFER so that the driver requesting the channel can also defer.Signed-off-by Heiko Stuebner <[email protected]>
I already have a patch queued up for this change in the fixes-togreg branch
[PATCH] iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name by Johannes Pointner
I'm just being a little slow catching up with patches at the moment.
J
Quoted 18 lines
--- drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/inkern.c +1
-1@@ -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",
Am Samstag, 30. August 2014, 11:29:04 schrieb Jonathan Cameron:
Quoted 7 lines · Heiko Stübner
Quoted 6 lines
Till now
of_iio_channel_get_by_namealways tried to find the channel without evaluating the return code fromof_iio_channel_get. This might include -EPROBE_DEFER in which case the channel is present but its driver simply not probed yet. Therefore simply return on -EPROBE_DEFER so that the driver requesting the channel can also defer.
Quoted 8 lines
Quoted 1 line
Signed-off-by Heiko Stuebner <[email protected]>I already have a patch queued up for this change in the fixes-togreg branch
[PATCH] iio:inkern: fix overwritten -EPROBE_DEFER in
of_iio_channel_get_by_nameby Johannes PointnerI'm just being a little slow catching up with patches at the moment.
no problem ... at least the issue got fixed :-)
Quoted 28 lines
J
Quoted 25 lines
---
drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/inkern.c +1
-1@@ -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",