iio: adc: ad9467: return ENODEV vs EINVAL in ad9467_setup()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 16 Sep 2020 08:22:21 +0000 (11:22 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 16 Sep 2020 18:15:54 +0000 (19:15 +0100)
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>
Link: https://lore.kernel.org/r/20200916082221.72851-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad9467.c

index 9c3ab46..f068256 100644 (file)
@@ -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;
        }
 }