diff mbox series

iio:adc:ad7766: Fix unnecessary check in ad7766_probe()

Message ID 20210511134739.948-1-tangbin@cmss.chinamobile.com (mailing list archive)
State New, archived
Headers show
Series iio:adc:ad7766: Fix unnecessary check in ad7766_probe() | expand

Commit Message

Tang Bin May 11, 2021, 1:47 p.m. UTC
In the function ad7766_probe(), the return value of
devm_iio_device_register() can be zero or ret, Thus it
is unnecessary to repeated check here.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/iio/adc/ad7766.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Jonathan Cameron May 13, 2021, 4:03 p.m. UTC | #1
On Tue, 11 May 2021 21:47:39 +0800
Tang Bin <tangbin@cmss.chinamobile.com> wrote:

> In the function ad7766_probe(), the return value of
> devm_iio_device_register() can be zero or ret, Thus it
> is unnecessary to repeated check here.
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>

Hi Tang Bin,

A quick query on this sign off sequence as I'd like to check what the
intended meaning is.

If you both developed this patch, please use the Co-developed-by: tag
to indicate that.   If Zhang Shengju wrote the patch then you sent it
upstream, please fix the 'from' field on the email to reflect that.

Patch itself is good.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad7766.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
> index b6b6765be..acf56e987 100644
> --- a/drivers/iio/adc/ad7766.c
> +++ b/drivers/iio/adc/ad7766.c
> @@ -291,10 +291,7 @@ static int ad7766_probe(struct spi_device *spi)
>  	if (ret)
>  		return ret;
>  
> -	ret = devm_iio_device_register(&spi->dev, indio_dev);
> -	if (ret)
> -		return ret;
> -	return 0;
> +	return devm_iio_device_register(&spi->dev, indio_dev);
>  }
>  
>  static const struct spi_device_id ad7766_id[] = {
Tang Bin May 14, 2021, 6:12 a.m. UTC | #2
Hi Jonathan:

On 2021/5/14 0:03, Jonathan Cameron wrote:
> On Tue, 11 May 2021 21:47:39 +0800
> Tang Bin <tangbin@cmss.chinamobile.com> wrote:
>
>> In the function ad7766_probe(), the return value of
>> devm_iio_device_register() can be zero or ret, Thus it
>> is unnecessary to repeated check here.
>>
>> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> Hi Tang Bin,
>
> A quick query on this sign off sequence as I'd like to check what the
> intended meaning is.
>
> If you both developed this patch, please use the Co-developed-by: tag
> to indicate that.   If Zhang Shengju wrote the patch then you sent it
> upstream, please fix the 'from' field on the email to reflect that.
>
> Patch itself is good.

Thanks for your reply, it's my mistake, this place should use:

     Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Thanks

Tang Bin


> Thanks,
>
> Jonathan
>
>> ---
>>   drivers/iio/adc/ad7766.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
>> index b6b6765be..acf56e987 100644
>> --- a/drivers/iio/adc/ad7766.c
>> +++ b/drivers/iio/adc/ad7766.c
>> @@ -291,10 +291,7 @@ static int ad7766_probe(struct spi_device *spi)
>>   	if (ret)
>>   		return ret;
>>   
>> -	ret = devm_iio_device_register(&spi->dev, indio_dev);
>> -	if (ret)
>> -		return ret;
>> -	return 0;
>> +	return devm_iio_device_register(&spi->dev, indio_dev);
>>   }
>>   
>>   static const struct spi_device_id ad7766_id[] = {
Jonathan Cameron May 16, 2021, 9:23 a.m. UTC | #3
On Fri, 14 May 2021 14:12:45 +0800
tangbin <tangbin@cmss.chinamobile.com> wrote:

> Hi Jonathan:
> 
> On 2021/5/14 0:03, Jonathan Cameron wrote:
> > On Tue, 11 May 2021 21:47:39 +0800
> > Tang Bin <tangbin@cmss.chinamobile.com> wrote:
> >  
> >> In the function ad7766_probe(), the return value of
> >> devm_iio_device_register() can be zero or ret, Thus it
> >> is unnecessary to repeated check here.
> >>
> >> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> >> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>  
> > Hi Tang Bin,
> >
> > A quick query on this sign off sequence as I'd like to check what the
> > intended meaning is.
> >
> > If you both developed this patch, please use the Co-developed-by: tag
> > to indicate that.   If Zhang Shengju wrote the patch then you sent it
> > upstream, please fix the 'from' field on the email to reflect that.
> >
> > Patch itself is good.  
> 
> Thanks for your reply, it's my mistake, this place should use:
> 
>      Co-developed-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Thanks for clarifying that.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to see if we missed anything.

Thanks,

Jonathan

> 
> Thanks
> 
> Tang Bin
> 
> 
> > Thanks,
> >
> > Jonathan
> >  
> >> ---
> >>   drivers/iio/adc/ad7766.c | 5 +----
> >>   1 file changed, 1 insertion(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
> >> index b6b6765be..acf56e987 100644
> >> --- a/drivers/iio/adc/ad7766.c
> >> +++ b/drivers/iio/adc/ad7766.c
> >> @@ -291,10 +291,7 @@ static int ad7766_probe(struct spi_device *spi)
> >>   	if (ret)
> >>   		return ret;
> >>   
> >> -	ret = devm_iio_device_register(&spi->dev, indio_dev);
> >> -	if (ret)
> >> -		return ret;
> >> -	return 0;
> >> +	return devm_iio_device_register(&spi->dev, indio_dev);
> >>   }
> >>   
> >>   static const struct spi_device_id ad7766_id[] = {  
> 
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
index b6b6765be..acf56e987 100644
--- a/drivers/iio/adc/ad7766.c
+++ b/drivers/iio/adc/ad7766.c
@@ -291,10 +291,7 @@  static int ad7766_probe(struct spi_device *spi)
 	if (ret)
 		return ret;
 
-	ret = devm_iio_device_register(&spi->dev, indio_dev);
-	if (ret)
-		return ret;
-	return 0;
+	return devm_iio_device_register(&spi->dev, indio_dev);
 }
 
 static const struct spi_device_id ad7766_id[] = {