All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
@ 2021-06-01 14:26 Yang Yingliang
  2021-06-03 16:18 ` Jonathan Cameron
  2021-06-04  7:57 ` Linus Walleij
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Yingliang @ 2021-06-01 14:26 UTC (permalink / raw)
  To: linux-kernel, linux-iio; +Cc: jic23, lars, Michael.Hennerich

Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().

Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/iio/frequency/adf4350.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index 1462a6a5bc6d..3d9eba716b69 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi)
 
 	st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
 							GPIOD_IN);
-	if (IS_ERR(st->lock_detect_gpiod))
-		return PTR_ERR(st->lock_detect_gpiod);
+	if (IS_ERR(st->lock_detect_gpiod)) {
+		ret = PTR_ERR(st->lock_detect_gpiod);
+		goto error_disable_reg;
+	}
 
 	if (pdata->power_up_frequency) {
 		ret = adf4350_set_freq(st, pdata->power_up_frequency);
-- 
2.25.1


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

* Re: [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
  2021-06-01 14:26 [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe() Yang Yingliang
@ 2021-06-03 16:18 ` Jonathan Cameron
  2021-06-04  1:35   ` Yang Yingliang
  2021-06-04  7:57 ` Linus Walleij
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2021-06-03 16:18 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: linux-kernel, linux-iio, lars, Michael.Hennerich, Linus Walleij

On Tue, 1 Jun 2021 22:26:05 +0800
Yang Yingliang <yangyingliang@huawei.com> wrote:

> Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().

Hi.

One small thing. It would be useful if you could check if the bug exists other
than in next (this one has been their for some time!)  If it does, please
don't add the -next in the patch title (as basically it makes me not worry
about reading it for a few days :)

Also, make sure to cc the author of the patch in the fixes tag
+CC Linus

Obvious enough fix (I hope) that I've applied it to the fixes-togreg branch of
iio.git and marked for stable.

Thanks,

Jonathan

> 
> Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/iio/frequency/adf4350.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> index 1462a6a5bc6d..3d9eba716b69 100644
> --- a/drivers/iio/frequency/adf4350.c
> +++ b/drivers/iio/frequency/adf4350.c
> @@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi)
>  
>  	st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
>  							GPIOD_IN);
> -	if (IS_ERR(st->lock_detect_gpiod))
> -		return PTR_ERR(st->lock_detect_gpiod);
> +	if (IS_ERR(st->lock_detect_gpiod)) {
> +		ret = PTR_ERR(st->lock_detect_gpiod);
> +		goto error_disable_reg;
> +	}
>  
>  	if (pdata->power_up_frequency) {
>  		ret = adf4350_set_freq(st, pdata->power_up_frequency);


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

* Re: [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
  2021-06-03 16:18 ` Jonathan Cameron
@ 2021-06-04  1:35   ` Yang Yingliang
  2021-06-11 17:30     ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Yingliang @ 2021-06-04  1:35 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-kernel, linux-iio, lars, Michael.Hennerich, Linus Walleij


On 2021/6/4 0:18, Jonathan Cameron wrote:
> On Tue, 1 Jun 2021 22:26:05 +0800
> Yang Yingliang <yangyingliang@huawei.com> wrote:
>
>> Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().
> Hi.
>
> One small thing. It would be useful if you could check if the bug exists other
> than in next (this one has been their for some time!)  If it does, please
> don't add the -next in the patch title (as basically it makes me not worry
> about reading it for a few days :)
>
> Also, make sure to cc the author of the patch in the fixes tag
> +CC Linus
OK

Thanks,
Yang
>
> Obvious enough fix (I hope) that I've applied it to the fixes-togreg branch of
> iio.git and marked for stable.
>
> Thanks,
>
> Jonathan
>
>> Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>   drivers/iio/frequency/adf4350.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
>> index 1462a6a5bc6d..3d9eba716b69 100644
>> --- a/drivers/iio/frequency/adf4350.c
>> +++ b/drivers/iio/frequency/adf4350.c
>> @@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi)
>>   
>>   	st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
>>   							GPIOD_IN);
>> -	if (IS_ERR(st->lock_detect_gpiod))
>> -		return PTR_ERR(st->lock_detect_gpiod);
>> +	if (IS_ERR(st->lock_detect_gpiod)) {
>> +		ret = PTR_ERR(st->lock_detect_gpiod);
>> +		goto error_disable_reg;
>> +	}
>>   
>>   	if (pdata->power_up_frequency) {
>>   		ret = adf4350_set_freq(st, pdata->power_up_frequency);
> .

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

* Re: [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
  2021-06-01 14:26 [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe() Yang Yingliang
  2021-06-03 16:18 ` Jonathan Cameron
@ 2021-06-04  7:57 ` Linus Walleij
  1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2021-06-04  7:57 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: linux-kernel, linux-iio, Jonathan Cameron, Lars-Peter Clausen,
	Michael Hennerich

On Tue, Jun 1, 2021 at 4:21 PM Yang Yingliang <yangyingliang@huawei.com> wrote:

> Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().
>
> Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
  2021-06-04  1:35   ` Yang Yingliang
@ 2021-06-11 17:30     ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2021-06-11 17:30 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: linux-kernel, linux-iio, lars, Michael.Hennerich, Linus Walleij

On Fri, 4 Jun 2021 09:35:49 +0800
Yang Yingliang <yangyingliang@huawei.com> wrote:

> On 2021/6/4 0:18, Jonathan Cameron wrote:
> > On Tue, 1 Jun 2021 22:26:05 +0800
> > Yang Yingliang <yangyingliang@huawei.com> wrote:
> >  
> >> Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().  
> > Hi.
> >
> > One small thing. It would be useful if you could check if the bug exists other
> > than in next (this one has been their for some time!)  If it does, please
> > don't add the -next in the patch title (as basically it makes me not worry
> > about reading it for a few days :)
> >
> > Also, make sure to cc the author of the patch in the fixes tag
> > +CC Linus  
> OK
> 
> Thanks,
> Yang
Hi Yang,

Change of plan on this one as we are late in the cycle and I don't have
any urgent fixes queued up.  I'm moving over to the togreg branch of iio.git
and lining it up for the current merge window.

Thanks,

Jonathan

> >
> > Obvious enough fix (I hope) that I've applied it to the fixes-togreg branch of
> > iio.git and marked for stable.
> >
> > Thanks,
> >
> > Jonathan
> >  
> >> Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
> >> Reported-by: Hulk Robot <hulkci@huawei.com>
> >> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> >> ---
> >>   drivers/iio/frequency/adf4350.c | 6 ++++--
> >>   1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> >> index 1462a6a5bc6d..3d9eba716b69 100644
> >> --- a/drivers/iio/frequency/adf4350.c
> >> +++ b/drivers/iio/frequency/adf4350.c
> >> @@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi)
> >>   
> >>   	st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
> >>   							GPIOD_IN);
> >> -	if (IS_ERR(st->lock_detect_gpiod))
> >> -		return PTR_ERR(st->lock_detect_gpiod);
> >> +	if (IS_ERR(st->lock_detect_gpiod)) {
> >> +		ret = PTR_ERR(st->lock_detect_gpiod);
> >> +		goto error_disable_reg;
> >> +	}
> >>   
> >>   	if (pdata->power_up_frequency) {
> >>   		ret = adf4350_set_freq(st, pdata->power_up_frequency);  
> > .  


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

end of thread, other threads:[~2021-06-11 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 14:26 [PATCH -next] iio: frequency: adf4350: disable reg and clk on error in adf4350_probe() Yang Yingliang
2021-06-03 16:18 ` Jonathan Cameron
2021-06-04  1:35   ` Yang Yingliang
2021-06-11 17:30     ` Jonathan Cameron
2021-06-04  7:57 ` Linus Walleij

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.