summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2016-08-04 15:38:46 +0200
committerMark Brown <broonie@kernel.org>2016-08-08 11:55:20 +0100
commit28405212b5f972c8a9f666a5bcd1abdcb4a5dd5a (patch)
treeb0071a4f1dbc8882483295a7f666a13c4bf52273
parent2da1e487cab4f3d134cc4b3ce2bd648660683900 (diff)
downloadlinux-28405212b5f972c8a9f666a5bcd1abdcb4a5dd5a.tar.gz
linux-28405212b5f972c8a9f666a5bcd1abdcb4a5dd5a.tar.bz2
linux-28405212b5f972c8a9f666a5bcd1abdcb4a5dd5a.zip
ASoC: samsung: Convert s3c24xx_uda134x to use devm_snd_soc_register_card()
Suppreses a following kernel warning: "soc-audio soc-audio: ASoC: machine S3C24XX_UDA134X should use snd_soc_register_card()". Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/s3c24xx_uda134x.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/sound/soc/samsung/s3c24xx_uda134x.c b/sound/soc/samsung/s3c24xx_uda134x.c
index 7119aabf0f78..13e52fb7b631 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -54,8 +54,6 @@ static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
};
#endif
-static struct platform_device *s3c24xx_uda134x_snd_device;
-
static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
{
int ret = 0;
@@ -66,7 +64,7 @@ static int s3c24xx_uda134x_startup(struct snd_pcm_substream *substream)
mutex_lock(&clk_lock);
pr_debug("%s %d\n", __func__, clk_users);
if (clk_users == 0) {
- xtal = clk_get(&s3c24xx_uda134x_snd_device->dev, "xtal");
+ xtal = clk_get(rtd->dev, "xtal");
if (IS_ERR(xtal)) {
printk(KERN_ERR "%s cannot get xtal\n", __func__);
ret = PTR_ERR(xtal);
@@ -228,43 +226,25 @@ static struct snd_soc_card snd_soc_s3c24xx_uda134x = {
static int s3c24xx_uda134x_probe(struct platform_device *pdev)
{
+ struct snd_soc_card *card = &snd_soc_s3c24xx_uda134x;
int ret;
- printk(KERN_INFO "S3C24XX_UDA134X SoC Audio driver\n");
-
- s3c24xx_uda134x_snd_device = platform_device_alloc("soc-audio", -1);
- if (!s3c24xx_uda134x_snd_device) {
- printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: "
- "Unable to register\n");
- return -ENOMEM;
- }
+ platform_set_drvdata(pdev, card);
+ card->dev = &pdev->dev;
- platform_set_drvdata(s3c24xx_uda134x_snd_device,
- &snd_soc_s3c24xx_uda134x);
-
- ret = platform_device_add(s3c24xx_uda134x_snd_device);
- if (ret) {
- printk(KERN_ERR "S3C24XX_UDA134X SoC Audio: Unable to add\n");
- platform_device_put(s3c24xx_uda134x_snd_device);
- }
+ ret = devm_snd_soc_register_card(&pdev->dev, card);
+ if (ret)
+ dev_err(&pdev->dev, "failed to register card: %d\n", ret);
return ret;
}
-static int s3c24xx_uda134x_remove(struct platform_device *pdev)
-{
- platform_device_unregister(s3c24xx_uda134x_snd_device);
- return 0;
-}
-
static struct platform_driver s3c24xx_uda134x_driver = {
.probe = s3c24xx_uda134x_probe,
- .remove = s3c24xx_uda134x_remove,
.driver = {
.name = "s3c24xx_uda134x",
},
};
-
module_platform_driver(s3c24xx_uda134x_driver);
MODULE_AUTHOR("Zoltan Devai, Christian Pellegrin <chripell@evolware.org>");