Commit 28b17011 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

ASoC: fsl: imx-es8328: use devm_snd_soc_register_card()

Using devm_snd_soc_register_card() can make the code
shorter and cleaner.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210602133359.310647-1-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d66e0339
...@@ -193,7 +193,7 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -193,7 +193,7 @@ static int imx_es8328_probe(struct platform_device *pdev)
data->card.owner = THIS_MODULE; data->card.owner = THIS_MODULE;
data->card.dai_link = &data->dai; data->card.dai_link = &data->dai;
ret = snd_soc_register_card(&data->card); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) { if (ret) {
dev_err(dev, "Unable to register: %d\n", ret); dev_err(dev, "Unable to register: %d\n", ret);
goto put_device; goto put_device;
...@@ -209,15 +209,6 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -209,15 +209,6 @@ static int imx_es8328_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int imx_es8328_remove(struct platform_device *pdev)
{
struct imx_es8328_data *data = platform_get_drvdata(pdev);
snd_soc_unregister_card(&data->card);
return 0;
}
static const struct of_device_id imx_es8328_dt_ids[] = { static const struct of_device_id imx_es8328_dt_ids[] = {
{ .compatible = "fsl,imx-audio-es8328", }, { .compatible = "fsl,imx-audio-es8328", },
{ /* sentinel */ } { /* sentinel */ }
...@@ -230,7 +221,6 @@ static struct platform_driver imx_es8328_driver = { ...@@ -230,7 +221,6 @@ static struct platform_driver imx_es8328_driver = {
.of_match_table = imx_es8328_dt_ids, .of_match_table = imx_es8328_dt_ids,
}, },
.probe = imx_es8328_probe, .probe = imx_es8328_probe,
.remove = imx_es8328_remove,
}; };
module_platform_driver(imx_es8328_driver); module_platform_driver(imx_es8328_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment