diff options
| author | Chancel Liu <chancel.liu@nxp.com> | 2026-09-23 15:12:46 +0900 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-23 14:22:46 +0200 |
| commit | 116f1bd60ae33ed794c502f56152a0384a80a2d6 (patch) | |
| tree | 6093284fe63578ec08a29f8914dc79272322edf3 /rust/kernel/alloc/kvec/errors.rs | |
| parent | 3713c74a1b0ad71b416345399d8a706c921cb47f (diff) | |
ASoC: codecs: da7218: Fix devm resource leaks across card bind/unbind
component->dev is the underlying I2C device, so resources requested
with devm_*(component->dev, ...) in the component .probe are only
released when the I2C device is removed, not on card unbind. This
leaks the mclk clock, the regulator bulk, the platform data parsed
from the device tree and the IRQ on every card bind/unbind cycle.
Move the mclk clock and the regulator supplies (pure hardware
resources tied to the I2C device) to da7218_i2c_probe() using devm on
&i2c->dev. Likewise move the device tree parsing (da7218_of_to_pdata()),
which also allocates with devm, to da7218_i2c_probe() and store the
result in da7218->pdata; the OF helpers now take a struct device so
they no longer depend on the component. Keep the IRQ in the component
.probe (it feeds the component) but request it with the non-devm API
and free it in da7218_remove().
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260923061305.4041197-3-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
