linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()
@ 2020-09-16  8:22 Alexandru Ardelean
  2020-09-16 18:16 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandru Ardelean @ 2020-09-16  8:22 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, Alexandru Ardelean

The proper error code should be ENODEV (vs EINVAL) in case the chip ID
isn't recognized.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/adc/ad9467.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 1e8fd83b9bc2..8a6682b567be 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -324,7 +324,7 @@ static int ad9467_setup(struct ad9467_state *st, unsigned int chip_id)
 				  AN877_ADC_OUTPUT_MODE_TWOS_COMPLEMENT;
 		return 0;
 	default:
-		return -EINVAL;
+		return -ENODEV;
 	}
 }
 
-- 
2.17.1


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

* Re: [PATCH] iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()
  2020-09-16  8:22 [PATCH] iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup() Alexandru Ardelean
@ 2020-09-16 18:16 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-09-16 18:16 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, linux-kernel

On Wed, 16 Sep 2020 11:22:21 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> The proper error code should be ENODEV (vs EINVAL) in case the chip ID
> isn't recognized.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad9467.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
> index 1e8fd83b9bc2..8a6682b567be 100644
> --- a/drivers/iio/adc/ad9467.c
> +++ b/drivers/iio/adc/ad9467.c
> @@ -324,7 +324,7 @@ static int ad9467_setup(struct ad9467_state *st, unsigned int chip_id)
>  				  AN877_ADC_OUTPUT_MODE_TWOS_COMPLEMENT;
>  		return 0;
>  	default:
> -		return -EINVAL;
> +		return -ENODEV;
>  	}
>  }
>  


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

end of thread, other threads:[~2020-09-16 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  8:22 [PATCH] iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup() Alexandru Ardelean
2020-09-16 18:16 ` Jonathan Cameron

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).