Unverified Commit 87fa872a authored by Linus Walleij's avatar Linus Walleij Committed by Mark Brown
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: da9146c1 ("ASoC: samsung: speyside: Convert to GPIO descriptor")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250312-cleanup-table-v1-1-1d9a14464482@linaro.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 02e1cf7a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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");