Skip to contentSkip to conversation

patch "iio: light: cm32181: return zero after writing calibscale" added to char-misc-next

PATCH [email protected] 1 participant 1 message Aug 19

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: light: cm32181: return zero after writing calibscale

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-next branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release during the merge window.

If you have any questions about this process, please let me know.

From 8756acd30919a3e9f547ea4a1d4b7f7895f4d340 Mon Sep 17 00:00:00 2001
From: Giorgi Tchankvetadze <[email protected]>
Date: Fri, 31 Jul 2026 17:20:48 +0400
Subject: iio: light: cm32181: return zero after writing calibscale

The write_raw callback is documented to return 0 on success or a negative error code. However, the IIO_CHAN_INFO_CALIBSCALE case returns 'val' (the user-supplied value) instead of 0.

Fix it by returning 0 on success, matching the behavior of other calibscale implementations in the subsystem.

Fixes 971672c0b3cc ("iio: add Capella CM32181 ambient light sensor driver.")
---
 drivers/iio/light/cm32181.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/cm32181.c +1 -1
index 2590fc8fd154..b32a94028f09 100644
@@ -368,7 +368,7 @@ static int cm32181_write_raw(struct iio_dev *indio_dev,
 	switch (mask) {
 	case IIO_CHAN_INFO_CALIBSCALE:
 		cm32181->calibscale = val;
-		return val;
+		return 0;
 	case IIO_CHAN_INFO_INT_TIME:
 		ret = cm32181_write_als_it(cm32181, val2);
 		return ret;
Signature · 1 line
2.55.0