Commit a815f93a authored by Mark Brown's avatar Mark Brown

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.
parents b6ea4284 00352af2
......@@ -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 @@ static int snd_proto_probe(struct platform_device *pdev)
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);
......
......@@ -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 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
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);
......
......@@ -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);
......
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