diff mbox series

iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()

Message ID 20200916082221.72851-1-alexandru.ardelean@analog.com (mailing list archive)
State New, archived
Headers show
Series iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup() | expand

Commit Message

Alexandru Ardelean Sept. 16, 2020, 8:22 a.m. UTC
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(-)

Comments

Jonathan Cameron Sept. 16, 2020, 6:16 p.m. UTC | #1
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;
>  	}
>  }
>
diff mbox series

Patch

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;
 	}
 }