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>
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 = {
.pm = &snd_soc_pm_ops,
},
.probe = bells_probe,
- .remove = bells_remove,
};
module_platform_driver(bells_driver);
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 = {
.pm = &snd_soc_pm_ops,
},
.probe = littlemill_probe,
- .remove = littlemill_remove,
};
module_platform_driver(littlemill_driver);
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 = {
.pm = &snd_soc_pm_ops,
},
.probe = lowland_probe,
- .remove = lowland_remove,
};
module_platform_driver(lowland_driver);
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 = {
.name = "samsung-smdk-pcm",
},
.probe = snd_smdk_probe,
- .remove = snd_smdk_remove,
};
module_platform_driver(snd_smdk_driver);
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 = {
.name = "samsung-smdk-pcm",
},
.probe = snd_smdk_probe,
- .remove = snd_smdk_remove,
};
module_platform_driver(snd_smdk_driver);
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 = {
.pm = &snd_soc_pm_ops,
},
.probe = speyside_probe,
- .remove = speyside_remove,
};
module_platform_driver(speyside_driver);
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 = {
.pm = &snd_soc_pm_ops,
},
.probe = tobermory_probe,
- .remove = tobermory_remove,
};
module_platform_driver(tobermory_driver);