[PATCH 2/2] ASoC: meson: card: unregister the card before freeing its links
Jerome Brunet
jbrunet at baylibre.com
Fri Oct 30 09:29:54 PDT 2026
The card is registered with devm, so it is only unregistered after
meson_card_remove() has freed its links.
Register the card without devm and unregister it in remove(), before
freeing the links.
Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support")
Signed-off-by: Jerome Brunet <jbrunet at baylibre.com>
---
sound/soc/meson/meson-card-utils.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c
index 3cdc73b3fe8b..24332f29047a 100644
--- a/sound/soc/meson/meson-card-utils.c
+++ b/sound/soc/meson/meson-card-utils.c
@@ -309,7 +309,7 @@ int meson_card_probe(struct platform_device *pdev)
if (ret)
goto out_err;
- ret = devm_snd_soc_register_card(dev, &priv->card);
+ ret = snd_soc_register_card(&priv->card);
if (ret)
goto out_err;
@@ -326,6 +326,7 @@ void meson_card_remove(struct platform_device *pdev)
struct snd_soc_card *card = platform_get_drvdata(pdev);
struct meson_card *priv = snd_soc_card_get_drvdata(card);
+ snd_soc_unregister_card(card);
meson_card_clean_references(priv);
}
EXPORT_SYMBOL_GPL(meson_card_remove);
--
2.53.0
More information about the linux-arm-kernel
mailing list