diff options
author | Crt Mori <cmo@melexis.com> | 2022-09-22 10:13:24 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-11-23 19:43:57 +0000 |
commit | 4e6151403631255828a5530d9d6233caedcd2976 (patch) | |
tree | 91093660589b0117b8a5cf747ab48afc665775ae /drivers/iio/temperature | |
parent | eff07b20700a55e5b39e76960934d6eeb56a12d9 (diff) | |
download | linux-stable-4e6151403631255828a5530d9d6233caedcd2976.tar.gz linux-stable-4e6151403631255828a5530d9d6233caedcd2976.tar.bz2 linux-stable-4e6151403631255828a5530d9d6233caedcd2976.zip |
iio: temperature: mlx90632 Change return value of sensor measurement channel
The current EINVAL value is more applicable to embedded library, where
user can actually put the fixed value to the sensor. In case of the
driver if the value of the channel is invalid it is better in inform
userspace that Channel was out of range as that implies more to internal
driver error than invalid input. It also makes for easier debugging of
where the error comes from during the development.
Signed-off-by: Crt Mori <cmo@melexis.com>
Link: https://lore.kernel.org/r/565d4df2592d751dc0f40908f2569b7c9af8e56e.1663834141.git.cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/temperature')
-rw-r--r-- | drivers/iio/temperature/mlx90632.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/temperature/mlx90632.c b/drivers/iio/temperature/mlx90632.c index 081803940261..224db7513baa 100644 --- a/drivers/iio/temperature/mlx90632.c +++ b/drivers/iio/temperature/mlx90632.c @@ -435,7 +435,7 @@ static int mlx90632_channel_new_select(int perform_ret, uint8_t *channel_new, *channel_old = 1; break; default: - return -EINVAL; + return -ECHRNG; } return 0; |