Skip to contentSkip to conversation

mfd: cs42l43: Fix issues in probe error paths

PATCH Applied Charles Keepax 2 participants 2 messages Oct 2, 2024 – Oct 9, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: cs42l43: Fix issues in probe error paths

The error path in cs42l43_boot_work() will lead to an unbalanced regulator put, when the driver is removed. Fix this by relying on remove to power down the device. Also the boot work needs to be synchronised with driver remove, to ensure the work is not still running after the driver has been removed. Add the required cancel_work_sync().

---
 drivers/mfd/cs42l43.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mfd/cs42l43.c +2 -1
index ae8fd37afb75..3b4efb294471 100644
@@ -967,7 +967,6 @@ static void cs42l43_boot_work(struct work_struct *work)
 
 err:
 	pm_runtime_put_sync(cs42l43->dev);
-	cs42l43_dev_remove(cs42l43);
 }
 
 static int cs42l43_power_up(struct cs42l43 *cs42l43)
@@ -1101,6 +1100,8 @@ EXPORT_SYMBOL_NS_GPL(cs42l43_dev_probe, MFD_CS42L43);
 
 void cs42l43_dev_remove(struct cs42l43 *cs42l43)
 {
+	cancel_work_sync(&cs42l43->boot_work);
+
 	cs42l43_power_down(cs42l43);
 }
 EXPORT_SYMBOL_NS_GPL(cs42l43_dev_remove, MFD_CS42L43);
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw

Re: (subset) [PATCH] mfd: cs42l43: Fix issues in probe error paths

Quoted 8 lines · Charles Keepax

The error path in cs42l43_boot_work() will lead to an unbalanced regulator put, when the driver is removed. Fix this by relying on remove to power down the device. Also the boot work needs to be synchronised with driver remove, to ensure the work is not still running after the driver has been removed. Add the required cancel_work_sync().

[...]

Applied, thanks!

[1/1] mfd: cs42l43: Fix issues in probe error paths

      commit: 416689a634c5bea3432facc8ae59187c71e7c47d

--
Lee Jones [李琼斯]