From daf79105f9b08a3f2cb205a32bf8e57c936095f4 Mon Sep 17 00:00:00 2001 From: Pengpeng Hou Date: Sat, 4 Jul 2026 15:15:11 +0800 Subject: [PATCH] iio: light: rpr0521: Propagate regcache_sync() errors rpr0521_runtime_suspend() powers the device down and marks the regmap cache dirty. rpr0521_runtime_resume() syncs the cache before restoring enabled ALS/PXS channels, but currently ignores a regcache_sync() failure and can still return success. Return the regcache_sync() error so resume does not hide a failed register restore. Signed-off-by: Pengpeng Hou Signed-off-by: Jonathan Cameron --- drivers/iio/light/rpr0521.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c index f961973892f2..e0914f699dfd 100644 --- a/drivers/iio/light/rpr0521.c +++ b/drivers/iio/light/rpr0521.c @@ -1071,7 +1071,10 @@ static int rpr0521_runtime_resume(struct device *dev) struct rpr0521_data *data = iio_priv(indio_dev); int ret; - regcache_sync(data->regmap); + ret = regcache_sync(data->regmap); + if (ret < 0) + return ret; + if (data->als_ps_need_en) { ret = rpr0521_als_enable(data, RPR0521_MODE_ALS_ENABLE); if (ret < 0)