]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: light: ltr501: return proper error code from ltr501_get_gain_index()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 2 Feb 2026 12:07:12 +0000 (14:07 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 3 Mar 2026 21:20:58 +0000 (21:20 +0000)
commit1ff6d25d691d1b10c977b61219206c3400a81606
tree1f3327c4c663ff83d3f9108826db9caa50ca356d
parent18a1ae3e7350e1798ea9f492959d5000ae5d9bc4
iio: light: ltr501: return proper error code from ltr501_get_gain_index()

Return -EINVAL instead of -1 when no matching gain value is found
in the gain table. Update the callers to propagate this error directly
rather than overwriting it with -EINVAL.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Waqar Hameed <waqar.hameed@axis.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/ltr501.c