[PATCH v6 04/11] iio: dac: mcp47feb02: Return len when disabling EEPROM store

From: Ariana Lazar

Date: Wed Sep 16 2026 - 10:28:13 EST


When state is false, return the number of bytes (len) the buffer has
instead of 0 to properly signal that the input buffer was fully consumed,
preventing unnecessary write retries.

Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02")
Reported-by: sashiko-bot@xxxxxxxxxx
Link: https://lore.kernel.org/all/20260804134616.1D8A21F00A3E@xxxxxxxxxxxxxxx/
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Ariana Lazar <ariana.lazar@xxxxxxxxxxxxx>
---
drivers/iio/dac/mcp47feb02.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/mcp47feb02.c b/drivers/iio/dac/mcp47feb02.c
index 81aa9063fcf730342d4af114da73ac2fc550243f..117fd41257d5cd430c00847ff64c22c6700dbb6a 100644
--- a/drivers/iio/dac/mcp47feb02.c
+++ b/drivers/iio/dac/mcp47feb02.c
@@ -468,7 +468,7 @@ static ssize_t store_eeprom_store(struct device *dev, struct device_attribute *a
return ret;

if (!state)
- return 0;
+ return len;

/*
* Verify DAC Wiper and DAC Configuration are unlocked. If both are disabled,

--
2.43.0