Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: light: rpr0521: Propagate regcache_sync() errors
@ 2026-07-04  7:15 Pengpeng Hou
  2026-07-04  7:54 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-07-04  7:15 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Uwe Kleine-König (The Capable Hub), Matti Vaittinen,
	Srinivas Pandruvada, Sakari Ailus, linux-iio, linux-kernel
  Cc: Pengpeng Hou

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>
---
 drivers/iio/light/rpr0521.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c
index f961973892f2..07f300bfe8e7 100644
--- a/drivers/iio/light/rpr0521.c
+++ b/drivers/iio/light/rpr0521.c
@@ -1071,7 +1071,9 @@ 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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-04  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-04  7:15 [PATCH] iio: light: rpr0521: Propagate regcache_sync() errors Pengpeng Hou
2026-07-04  7:54 ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox