linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name
@ 2014-08-28 22:13 Heiko Stübner
  2014-08-30 10:29 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Stübner @ 2014-08-28 22:13 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, linux-kernel

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.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/iio/inkern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index c749700..f084610 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",
-- 
2.0.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name
  2014-08-28 22:13 [PATCH] iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name Heiko Stübner
@ 2014-08-30 10:29 ` Jonathan Cameron
  2014-08-30 10:51   ` Heiko Stübner
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2014-08-30 10:29 UTC (permalink / raw)
  To: Heiko Stübner; +Cc: linux-iio, linux-kernel

On 28/08/14 23:13, Heiko Stübner wrote:
> 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.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
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
> ---
>  drivers/iio/inkern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index c749700..f084610 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",
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name
  2014-08-30 10:29 ` Jonathan Cameron
@ 2014-08-30 10:51   ` Heiko Stübner
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2014-08-30 10:51 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, linux-kernel

Am Samstag, 30. August 2014, 11:29:04 schrieb Jonathan Cameron:
> On 28/08/14 23:13, Heiko Stübner wrote:
> > 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.
> > 
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> 
> 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.

no problem ... at least the issue got fixed :-)


> 
> J
> 
> > ---
> > 
> >  drivers/iio/inkern.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> > index c749700..f084610 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",


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-30 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-28 22:13 [PATCH] iio: handle -EPROBE_DEFER in of_iio_channel_get_by_name Heiko Stübner
2014-08-30 10:29 ` Jonathan Cameron
2014-08-30 10:51   ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).