* [PATCH] iio: flow: slf3s: disable regulator if measurement restart fails
@ 2026-09-01 2:50 Li Youhong
0 siblings, 0 replies; only message in thread
From: Li Youhong @ 2026-09-01 2:50 UTC (permalink / raw)
To: wafgo01, jic23; +Cc: maxwell, dlechner, nuno.sa, andy, linux-iio, Li Youhong
From: Li Youhong <liyouhong@kylinos.cn>
slf3s_resume() enables the vdd regulator and then starts continuous
measurement. If slf3s_start_meas() fails, resume returns an error
while leaving the regulator enabled. Disable vdd on that path so a
failed resume does not leave the supply on.
Fixes: d240b0b8a1ce ("iio: flow: add Sensirion SLF3S liquid flow sensor driver")
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
---
drivers/iio/flow/slf3s.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/flow/slf3s.c b/drivers/iio/flow/slf3s.c
index dfa7c1409045..9b63ceb3768a 100644
--- a/drivers/iio/flow/slf3s.c
+++ b/drivers/iio/flow/slf3s.c
@@ -487,7 +487,11 @@ static int slf3s_resume(struct device *dev)
fsleep(SLF3S_POWER_UP_DELAY_US);
- return slf3s_start_meas(sf, sf->medium);
+ ret = slf3s_start_meas(sf, sf->medium);
+ if (ret)
+ regulator_disable(sf->vdd);
+
+ return ret;
}
static DEFINE_SIMPLE_DEV_PM_OPS(slf3s_pm_ops, slf3s_suspend, slf3s_resume);
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-01 2:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 2:50 [PATCH] iio: flow: slf3s: disable regulator if measurement restart fails Li Youhong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox