All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()
@ 2013-05-24  2:42 Jonghwan Choi
  2013-05-27 10:33 ` Luis Henriques
  2013-06-02 15:12 ` Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Jonghwan Choi @ 2013-05-24  2:42 UTC (permalink / raw)
  To: 'Jonghwan Choi', linux-kernel
  Cc: stable, 'Wei Yongjun', 'Jonathan Cameron'

This patch looks like it should be in the 3.9-stable tree, should we apply
it?

------------------

From: "Wei Yongjun <yongjun_wei@trendmicro.com.cn>"

commit 3b813798aa7030f1beef638c75f8b0008f737a82 upstream

Fix to return -EINVAL in the i2c device found error handling
case instead of 0, as done elsewhere in this function.
And also correct the fail1 and fail2 lable to do the right thing.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 drivers/staging/iio/light/tsl2x7x_core.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c
b/drivers/staging/iio/light/tsl2x7x_core.c
index a58731e..2d40c03 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
 		dev_info(&chip->client->dev,
 				"%s: i2c device found does not match
expected id\n",
 				__func__);
+		ret = -EINVAL;
 		goto fail1;
 	}
 
@@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
 		if (ret) {
 			dev_err(&clientp->dev,
 				"%s: irq request failed", __func__);
-			goto fail2;
+			goto fail1;
 		}
 	}
 
@@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
 	if (ret) {
 		dev_err(&clientp->dev,
 			"%s: iio registration failed\n", __func__);
-		goto fail1;
+		goto fail2;
 	}
 
 	dev_info(&clientp->dev, "%s Light sensor found.\n", id->name);
 
 	return 0;
 
-fail1:
+fail2:
 	if (clientp->irq)
 		free_irq(clientp->irq, indio_dev);
-fail2:
+fail1:
 	iio_device_free(indio_dev);
 
 	return ret;
-- 
1.7.9.5


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

* Re: [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()
  2013-05-24  2:42 [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe() Jonghwan Choi
@ 2013-05-27 10:33 ` Luis Henriques
  2013-06-02 15:12 ` Jonathan Cameron
  1 sibling, 0 replies; 4+ messages in thread
From: Luis Henriques @ 2013-05-27 10:33 UTC (permalink / raw)
  To: Jonghwan Choi
  Cc: linux-kernel, stable, 'Wei Yongjun', 'Jonathan Cameron'

Hi Jonghwan,

Jonghwan Choi <jhbird.choi@samsung.com> writes:

> This patch looks like it should be in the 3.9-stable tree, should we apply
> it?

I'm queuing this patch to the 3.5 kernel as well, as it looks like it
is also applicable.

Cheers,
-- 
Luis


>
> ------------------
>
> From: "Wei Yongjun <yongjun_wei@trendmicro.com.cn>"
>
> commit 3b813798aa7030f1beef638c75f8b0008f737a82 upstream
>
> Fix to return -EINVAL in the i2c device found error handling
> case instead of 0, as done elsewhere in this function.
> And also correct the fail1 and fail2 lable to do the right thing.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  drivers/staging/iio/light/tsl2x7x_core.c |    9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/iio/light/tsl2x7x_core.c
> b/drivers/staging/iio/light/tsl2x7x_core.c
> index a58731e..2d40c03 100644
> --- a/drivers/staging/iio/light/tsl2x7x_core.c
> +++ b/drivers/staging/iio/light/tsl2x7x_core.c
> @@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  		dev_info(&chip->client->dev,
>  				"%s: i2c device found does not match
> expected id\n",
>  				__func__);
> +		ret = -EINVAL;
>  		goto fail1;
>  	}
>  
> @@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  		if (ret) {
>  			dev_err(&clientp->dev,
>  				"%s: irq request failed", __func__);
> -			goto fail2;
> +			goto fail1;
>  		}
>  	}
>  
> @@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  	if (ret) {
>  		dev_err(&clientp->dev,
>  			"%s: iio registration failed\n", __func__);
> -		goto fail1;
> +		goto fail2;
>  	}
>  
>  	dev_info(&clientp->dev, "%s Light sensor found.\n", id->name);
>  
>  	return 0;
>  
> -fail1:
> +fail2:
>  	if (clientp->irq)
>  		free_irq(clientp->irq, indio_dev);
> -fail2:
> +fail1:
>  	iio_device_free(indio_dev);
>  
>  	return ret;

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

* Re: [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()
  2013-05-24  2:42 [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe() Jonghwan Choi
  2013-05-27 10:33 ` Luis Henriques
@ 2013-06-02 15:12 ` Jonathan Cameron
  2013-06-02 22:57   ` Jonghwan Choi
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2013-06-02 15:12 UTC (permalink / raw)
  To: Jonghwan Choi
  Cc: linux-kernel, stable, 'Wei Yongjun', 'Jonathan Cameron'

On 05/24/2013 03:42 AM, Jonghwan Choi wrote:
> This patch looks like it should be in the 3.9-stable tree, should we apply
> it?
It's a pretty unlikely problem to hit in reality so up to you on whether
you think it worth picking up.  Also note that only the -EINVAL bit
is actually a fix. The rest of it was some incidental tidying up.

Jonathan

> ------------------
>
> From: "Wei Yongjun <yongjun_wei@trendmicro.com.cn>"
>
> commit 3b813798aa7030f1beef638c75f8b0008f737a82 upstream
>
> Fix to return -EINVAL in the i2c device found error handling
> case instead of 0, as done elsewhere in this function.
> And also correct the fail1 and fail2 lable to do the right thing.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  drivers/staging/iio/light/tsl2x7x_core.c |    9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/iio/light/tsl2x7x_core.c
> b/drivers/staging/iio/light/tsl2x7x_core.c
> index a58731e..2d40c03 100644
> --- a/drivers/staging/iio/light/tsl2x7x_core.c
> +++ b/drivers/staging/iio/light/tsl2x7x_core.c
> @@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  		dev_info(&chip->client->dev,
>  				"%s: i2c device found does not match
> expected id\n",
>  				__func__);
> +		ret = -EINVAL;
>  		goto fail1;
>  	}
>  
> @@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  		if (ret) {
>  			dev_err(&clientp->dev,
>  				"%s: irq request failed", __func__);
> -			goto fail2;
> +			goto fail1;
>  		}
>  	}
>  
> @@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
>  	if (ret) {
>  		dev_err(&clientp->dev,
>  			"%s: iio registration failed\n", __func__);
> -		goto fail1;
> +		goto fail2;
>  	}
>  
>  	dev_info(&clientp->dev, "%s Light sensor found.\n", id->name);
>  
>  	return 0;
>  
> -fail1:
> +fail2:
>  	if (clientp->irq)
>  		free_irq(clientp->irq, indio_dev);
> -fail2:
> +fail1:
>  	iio_device_free(indio_dev);
>  
>  	return ret;


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

* RE: [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()
  2013-06-02 15:12 ` Jonathan Cameron
@ 2013-06-02 22:57   ` Jonghwan Choi
  0 siblings, 0 replies; 4+ messages in thread
From: Jonghwan Choi @ 2013-06-02 22:57 UTC (permalink / raw)
  To: 'Jonathan Cameron'
  Cc: linux-kernel, stable, 'Wei Yongjun', 'Jonathan Cameron'

Thanks for the kind reply.

Best Regards.~

> -----Original Message-----
> From: Jonathan Cameron [mailto:jic23@jic23.retrosnub.co.uk]
> Sent: Monday, June 03, 2013 12:13 AM
> To: Jonghwan Choi
> Cc: linux-kernel@vger.kernel.org; stable@vger.kernel.org; 'Wei Yongjun';
> 'Jonathan Cameron'
> Subject: Re: [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error
> handling in tsl2x7x_probe()
> 
> On 05/24/2013 03:42 AM, Jonghwan Choi wrote:
> > This patch looks like it should be in the 3.9-stable tree, should we
> apply
> > it?
> It's a pretty unlikely problem to hit in reality so up to you on whether
> you think it worth picking up.  Also note that only the -EINVAL bit
> is actually a fix. The rest of it was some incidental tidying up.
> 
> Jonathan
> 
> > ------------------
> >
> > From: "Wei Yongjun <yongjun_wei@trendmicro.com.cn>"
> >
> > commit 3b813798aa7030f1beef638c75f8b0008f737a82 upstream
> >
> > Fix to return -EINVAL in the i2c device found error handling
> > case instead of 0, as done elsewhere in this function.
> > And also correct the fail1 and fail2 lable to do the right thing.
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> > Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> > ---
> >  drivers/staging/iio/light/tsl2x7x_core.c |    9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/iio/light/tsl2x7x_core.c
> > b/drivers/staging/iio/light/tsl2x7x_core.c
> > index a58731e..2d40c03 100644
> > --- a/drivers/staging/iio/light/tsl2x7x_core.c
> > +++ b/drivers/staging/iio/light/tsl2x7x_core.c
> > @@ -1869,6 +1869,7 @@ static int tsl2x7x_probe(struct i2c_client
> *clientp,
> >  		dev_info(&chip->client->dev,
> >  				"%s: i2c device found does not match
> > expected id\n",
> >  				__func__);
> > +		ret = -EINVAL;
> >  		goto fail1;
> >  	}
> >
> > @@ -1907,7 +1908,7 @@ static int tsl2x7x_probe(struct i2c_client
> *clientp,
> >  		if (ret) {
> >  			dev_err(&clientp->dev,
> >  				"%s: irq request failed", __func__);
> > -			goto fail2;
> > +			goto fail1;
> >  		}
> >  	}
> >
> > @@ -1920,17 +1921,17 @@ static int tsl2x7x_probe(struct i2c_client
> *clientp,
> >  	if (ret) {
> >  		dev_err(&clientp->dev,
> >  			"%s: iio registration failed\n", __func__);
> > -		goto fail1;
> > +		goto fail2;
> >  	}
> >
> >  	dev_info(&clientp->dev, "%s Light sensor found.\n", id->name);
> >
> >  	return 0;
> >
> > -fail1:
> > +fail2:
> >  	if (clientp->irq)
> >  		free_irq(clientp->irq, indio_dev);
> > -fail2:
> > +fail1:
> >  	iio_device_free(indio_dev);
> >
> >  	return ret;


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

end of thread, other threads:[~2013-06-02 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24  2:42 [PATCH 3.9-stable] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe() Jonghwan Choi
2013-05-27 10:33 ` Luis Henriques
2013-06-02 15:12 ` Jonathan Cameron
2013-06-02 22:57   ` Jonghwan Choi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.