Skip to content

Commit 87fa872

Browse files
linuswbroonie
authored andcommitted
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 <[email protected]> Fixes: da9146c ("ASoC: samsung: speyside: Convert to GPIO descriptor") Signed-off-by: Linus Walleij <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 02e1cf7 commit 87fa872

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sound/soc/samsung/speyside.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ static struct gpiod_lookup_table wm8996_gpiod_table = {
347347
},
348348
};
349349

350+
static void speyside_gpiod_table_action(void *data)
351+
{
352+
gpiod_remove_lookup_table(&wm8996_gpiod_table);
353+
}
354+
350355
static int speyside_probe(struct platform_device *pdev)
351356
{
352357
struct snd_soc_card *card = &speyside;
@@ -355,6 +360,11 @@ static int speyside_probe(struct platform_device *pdev)
355360
card->dev = &pdev->dev;
356361

357362
gpiod_add_lookup_table(&wm8996_gpiod_table);
363+
ret = devm_add_action_or_reset(&pdev->dev, speyside_gpiod_table_action,
364+
NULL);
365+
if (ret)
366+
return ret;
367+
358368
ret = devm_snd_soc_register_card(&pdev->dev, card);
359369
if (ret)
360370
dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");

0 commit comments

Comments
 (0)