mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
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:
parent
7a2ccd0a17
commit
daf79105f9
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user