Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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().

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241002121311.162691-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Charles Keepax and committed by
Lee Jones
e59148b7 bf231e5f

+2 -1
+2 -1
drivers/mfd/cs42l43.c
··· 967 967 968 968 err: 969 969 pm_runtime_put_sync(cs42l43->dev); 970 - cs42l43_dev_remove(cs42l43); 971 970 } 972 971 973 972 static int cs42l43_power_up(struct cs42l43 *cs42l43) ··· 1100 1101 1101 1102 void cs42l43_dev_remove(struct cs42l43 *cs42l43) 1102 1103 { 1104 + cancel_work_sync(&cs42l43->boot_work); 1105 + 1103 1106 cs42l43_power_down(cs42l43); 1104 1107 } 1105 1108 EXPORT_SYMBOL_NS_GPL(cs42l43_dev_remove, MFD_CS42L43);