diff options
author | 2025-03-12 11:02:25 +0100 | |
---|---|---|
committer | 2025-03-12 12:39:57 +0000 | |
commit | 87fa872a1ecf542efc66a9184127faf03037f827 (patch) | |
tree | 0d4f36077857e3570a78fe11c0339ad99cb1a3f4 | |
parent | ASoC: amd: acp: Fix for enabling DMIC on acp platforms via _DSD entry (diff) | |
download | wireguard-linux-87fa872a1ecf542efc66a9184127faf03037f827.tar.xz wireguard-linux-87fa872a1ecf542efc66a9184127faf03037f827.zip |
ASoC: samsung: speyside: Free gpiod table
We create a gpio descriptor table but it needs to be free:ed
when the module is removed. Add a devm_ action to do the job.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: da9146c19b17 ("ASoC: samsung: speyside: Convert to GPIO descriptor")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250312-cleanup-table-v1-1-1d9a14464482@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/samsung/speyside.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index f781e2be2fd4..9262e5626584 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -347,6 +347,11 @@ static struct gpiod_lookup_table wm8996_gpiod_table = { }, }; +static void speyside_gpiod_table_action(void *data) +{ + gpiod_remove_lookup_table(&wm8996_gpiod_table); +} + static int speyside_probe(struct platform_device *pdev) { struct snd_soc_card *card = &speyside; @@ -355,6 +360,11 @@ static int speyside_probe(struct platform_device *pdev) card->dev = &pdev->dev; gpiod_add_lookup_table(&wm8996_gpiod_table); + ret = devm_add_action_or_reset(&pdev->dev, speyside_gpiod_table_action, + NULL); + if (ret) + return ret; + ret = devm_snd_soc_register_card(&pdev->dev, card); if (ret) dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n"); |