* [PATCH] mfd: cs42l43: Fix issues in probe error paths
@ 2024-10-02 12:13 Charles Keepax
2024-10-09 15:53 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2024-10-02 12:13 UTC (permalink / raw)
To: lee; +Cc: patches, linux-kernel
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().
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/mfd/cs42l43.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c
index ae8fd37afb75..3b4efb294471 100644
--- a/drivers/mfd/cs42l43.c
+++ b/drivers/mfd/cs42l43.c
@@ -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);
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: (subset) [PATCH] mfd: cs42l43: Fix issues in probe error paths
2024-10-02 12:13 [PATCH] mfd: cs42l43: Fix issues in probe error paths Charles Keepax
@ 2024-10-09 15:53 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2024-10-09 15:53 UTC (permalink / raw)
To: lee, Charles Keepax; +Cc: patches, linux-kernel
On Wed, 02 Oct 2024 13:13:11 +0100, Charles Keepax wrote:
> 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 [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-09 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-02 12:13 [PATCH] mfd: cs42l43: Fix issues in probe error paths Charles Keepax
2024-10-09 15:53 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®