mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
ASoC: samsung: Use devm_snd_soc_register_card
Replace snd_soc_register_card with devm_snd_soc_register_card. With this change, we can delete the empty remove functions. Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
fbfad49076
commit
c583883ecd
@ -433,22 +433,13 @@ static int bells_probe(struct platform_device *pdev)
|
||||
|
||||
bells_cards[pdev->id].dev = &pdev->dev;
|
||||
|
||||
ret = snd_soc_register_card(&bells_cards[pdev->id]);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, &bells_cards[pdev->id]);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev,
|
||||
"snd_soc_register_card(%s) failed: %d\n",
|
||||
bells_cards[pdev->id].name, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bells_remove(struct platform_device *pdev)
|
||||
{
|
||||
snd_soc_unregister_card(&bells_cards[pdev->id]);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver bells_driver = {
|
||||
@ -458,7 +449,6 @@ static struct platform_driver bells_driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = bells_probe,
|
||||
.remove = bells_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(bells_driver);
|
||||
|
@ -304,23 +304,12 @@ static int littlemill_probe(struct platform_device *pdev)
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int littlemill_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
|
||||
snd_soc_unregister_card(card);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver littlemill_driver = {
|
||||
@ -330,7 +319,6 @@ static struct platform_driver littlemill_driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = littlemill_probe,
|
||||
.remove = littlemill_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(littlemill_driver);
|
||||
|
@ -187,23 +187,12 @@ static int lowland_probe(struct platform_device *pdev)
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lowland_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
|
||||
snd_soc_unregister_card(card);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver lowland_driver = {
|
||||
@ -213,7 +202,6 @@ static struct platform_driver lowland_driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = lowland_probe,
|
||||
.remove = lowland_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(lowland_driver);
|
||||
|
@ -164,19 +164,11 @@ static int snd_smdk_probe(struct platform_device *pdev)
|
||||
xtal_freq = mclk_freq = SMDK_WM8580_EXT_VOICE;
|
||||
|
||||
smdk_pcm.dev = &pdev->dev;
|
||||
ret = snd_soc_register_card(&smdk_pcm);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_smdk_remove(struct platform_device *pdev)
|
||||
{
|
||||
snd_soc_unregister_card(&smdk_pcm);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver snd_smdk_driver = {
|
||||
@ -185,7 +177,6 @@ static struct platform_driver snd_smdk_driver = {
|
||||
.name = "samsung-smdk-pcm",
|
||||
},
|
||||
.probe = snd_smdk_probe,
|
||||
.remove = snd_smdk_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(snd_smdk_driver);
|
||||
|
@ -134,19 +134,11 @@ static int snd_smdk_probe(struct platform_device *pdev)
|
||||
int ret = 0;
|
||||
|
||||
smdk_pcm.dev = &pdev->dev;
|
||||
ret = snd_soc_register_card(&smdk_pcm);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_smdk_remove(struct platform_device *pdev)
|
||||
{
|
||||
snd_soc_unregister_card(&smdk_pcm);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver snd_smdk_driver = {
|
||||
@ -155,7 +147,6 @@ static struct platform_driver snd_smdk_driver = {
|
||||
.name = "samsung-smdk-pcm",
|
||||
},
|
||||
.probe = snd_smdk_probe,
|
||||
.remove = snd_smdk_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(snd_smdk_driver);
|
||||
|
@ -327,23 +327,12 @@ static int speyside_probe(struct platform_device *pdev)
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int speyside_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
|
||||
snd_soc_unregister_card(card);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver speyside_driver = {
|
||||
@ -353,7 +342,6 @@ static struct platform_driver speyside_driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = speyside_probe,
|
||||
.remove = speyside_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(speyside_driver);
|
||||
|
@ -223,23 +223,12 @@ static int tobermory_probe(struct platform_device *pdev)
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret) {
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret)
|
||||
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int tobermory_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
|
||||
snd_soc_unregister_card(card);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver tobermory_driver = {
|
||||
@ -249,7 +238,6 @@ static struct platform_driver tobermory_driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = tobermory_probe,
|
||||
.remove = tobermory_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(tobermory_driver);
|
||||
|
Loading…
Reference in New Issue
Block a user