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

From: Ariana Lazar

Date: Fri Sep 18 2026 - 05:23:04 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
Closes: 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 d910a6cf9718d6c6ad68eb1bb1ff5f3b15b33e84..2bd2e1bd93db01f79122aaeda2ba4ff14320b404 100644
--- a/drivers/iio/dac/mcp47feb02.c
+++ b/drivers/iio/dac/mcp47feb02.c
@@ -467,7 +467,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