ASoC: use devm_snd_soc_register_card()

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

These are v2 to use devm_snd_soc_register_card() on ASoC.
This commit is contained in:
Mark Brown 2024-01-22 21:08:17 +00:00
commit a815f93a7d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
3 changed files with 3 additions and 23 deletions

View File

@ -140,7 +140,7 @@ static int snd_proto_probe(struct platform_device *pdev)
dai->dai_fmt = dai_fmt;
ret = snd_soc_register_card(&snd_proto);
ret = devm_snd_soc_register_card(&pdev->dev, &snd_proto);
if (ret)
dev_err_probe(&pdev->dev, ret,
"snd_soc_register_card() failed\n");
@ -155,11 +155,6 @@ put_codec_node:
return ret;
}
static void snd_proto_remove(struct platform_device *pdev)
{
snd_soc_unregister_card(&snd_proto);
}
static const struct of_device_id snd_proto_of_match[] = {
{ .compatible = "mikroe,mikroe-proto", },
{},
@ -172,7 +167,6 @@ static struct platform_driver snd_proto_driver = {
.of_match_table = snd_proto_of_match,
},
.probe = snd_proto_probe,
.remove_new = snd_proto_remove,
};
module_platform_driver(snd_proto_driver);

View File

@ -196,7 +196,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
}
}
ret = snd_soc_register_card(&eukrea_tlv320);
ret = devm_snd_soc_register_card(&pdev->dev, &eukrea_tlv320);
err:
if (ret)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
@ -205,11 +205,6 @@ err:
return ret;
}
static void eukrea_tlv320_remove(struct platform_device *pdev)
{
snd_soc_unregister_card(&eukrea_tlv320);
}
static const struct of_device_id imx_tlv320_dt_ids[] = {
{ .compatible = "eukrea,asoc-tlv320"},
{ /* sentinel */ }
@ -222,7 +217,6 @@ static struct platform_driver eukrea_tlv320_driver = {
.of_match_table = imx_tlv320_dt_ids,
},
.probe = eukrea_tlv320_probe,
.remove_new = eukrea_tlv320_remove,
};
module_platform_driver(eukrea_tlv320_driver);

View File

@ -379,7 +379,7 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
card->num_links = 1;
card->dev = dev;
ret = snd_soc_register_card(card);
ret = devm_snd_soc_register_card(dev, card);
if (ret) {
dev_err(dev, "snd_soc_register_card failed (%d)\n", ret);
return ret;
@ -393,19 +393,11 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
return 0;
}
static void omap_hdmi_audio_remove(struct platform_device *pdev)
{
struct hdmi_audio_data *ad = platform_get_drvdata(pdev);
snd_soc_unregister_card(ad->card);
}
static struct platform_driver hdmi_audio_driver = {
.driver = {
.name = DRV_NAME,
},
.probe = omap_hdmi_audio_probe,
.remove_new = omap_hdmi_audio_remove,
};
module_platform_driver(hdmi_audio_driver);