From 7a2ccd0a17fe3183714b9c00810027064b2a3fba Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Sat, 4 Jul 2026 15:14:10 +0800 Subject: [PATCH] iio: light: vcnl4035: Propagate regcache_sync() errors vcnl4035_runtime_suspend() marks the regmap cache dirty before runtime suspend. vcnl4035_runtime_resume() then syncs the cache before re- enabling ALS, but currently ignores a regcache_sync() failure and can still report resume success. Return the regcache_sync() error so the PM core sees the failed register restore. Signed-off-by: Pengpeng Hou Signed-off-by: Jonathan Cameron --- drivers/iio/light/vcnl4035.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c index bf3a49b4351d..d13c5ff33e07 100644 --- a/drivers/iio/light/vcnl4035.c +++ b/drivers/iio/light/vcnl4035.c @@ -647,7 +647,10 @@ static int vcnl4035_runtime_resume(struct device *dev) struct vcnl4035_data *data = iio_priv(indio_dev); int ret; - regcache_sync(data->regmap); + ret = regcache_sync(data->regmap); + if (ret < 0) + return ret; + ret = vcnl4035_set_als_power_state(data, VCNL4035_MODE_ALS_ENABLE); if (ret < 0) return ret;