Skip to content

Commit

Permalink
ASoC: fsl: imx-es8328: use devm_snd_soc_register_card()
Browse files Browse the repository at this point in the history
Using devm_snd_soc_register_card() can make the code
shorter and cleaner.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210602133359.310647-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Yang Yingliang authored and Mark Brown committed Jun 3, 2021
1 parent d66e033 commit 28b1701
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions sound/soc/fsl/imx-es8328.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static int imx_es8328_probe(struct platform_device *pdev)
data->card.owner = THIS_MODULE;
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) {
dev_err(dev, "Unable to register: %d\n", ret);
goto put_device;
Expand All @@ -209,15 +209,6 @@ static int imx_es8328_probe(struct platform_device *pdev)
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[] = {
{ .compatible = "fsl,imx-audio-es8328", },
{ /* sentinel */ }
Expand All @@ -230,7 +221,6 @@ static struct platform_driver imx_es8328_driver = {
.of_match_table = imx_es8328_dt_ids,
},
.probe = imx_es8328_probe,
.remove = imx_es8328_remove,
};
module_platform_driver(imx_es8328_driver);

Expand Down

0 comments on commit 28b1701

Please sign in to comment.