Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Crt Mori and committed by
Jonathan Cameron
4e615140 eff07b20

+1 -1
+1 -1
drivers/iio/temperature/mlx90632.c
··· 435 435 *channel_old = 1; 436 436 break; 437 437 default: 438 - return -EINVAL; 438 + return -ECHRNG; 439 439 } 440 440 441 441 return 0;