diff options
| author | 2026-09-23 15:12:48 +0900 | |
|---|---|---|
| committer | 2026-09-23 14:22:48 +0200 | |
| commit | 99fff20db8ded3003e4d525d8db34f731316ea92 (patch) | |
| tree | 61c4427edb1f35fc428ed269d107e07d3e550096 /scripts/Makefile.thinlto | |
| parent | ASoC: codecs: tlv320aic32x4: Fix clock leak from runtime callbacks (diff) | |
ASoC: codecs: twl4030: Acquire board params and hs_extmute GPIO in the platform probe
The component .probe/.remove callbacks fire on ASoC card bind/unbind, but
component->dev is the underlying platform device whose devres is only
released on physical device removal. Resources allocated with
devm_*(component->dev, ...) in the component probe are therefore never
freed on card unbind, leaking one copy per bind/unbind cycle and leaking
the hs_extmute GPIO descriptor (which can also fail to be re-acquired on
re-bind).
The board parameters and the hs_extmute GPIO are pure hardware/device
level resources: they only depend on the physical device and the DT, not
on the ASoC component. Acquire them (together with the driver context)
in twl4030_codec_probe() using devm on the platform device, and hand the
context to the component through drvdata. Their devres lifetime then
correctly follows the device rather than the card bind/unbind, so no
explicit component .remove is needed. The component probe keeps only the
codec register initialisation that genuinely needs the component.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260923061305.4041197-5-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
