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 <pengpeng@iscas.ac.cn>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
Pengpeng Hou 2026-07-04 15:15:11 +08:00 committed by Jonathan Cameron
parent 7a2ccd0a17
commit daf79105f9

View File

@ -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)