ASoC: samsung: Use devm_snd_soc_register_card
authorTushar Behera <tushar.behera@linaro.org>
Wed, 21 May 2014 03:22:17 +0000 (08:52 +0530)
committerMark Brown <broonie@linaro.org>
Wed, 21 May 2014 23:20:11 +0000 (00:20 +0100)
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>
sound/soc/samsung/bells.c
sound/soc/samsung/littlemill.c
sound/soc/samsung/lowland.c
sound/soc/samsung/smdk_wm8580pcm.c
sound/soc/samsung/smdk_wm8994pcm.c
sound/soc/samsung/speyside.c
sound/soc/samsung/tobermory.c

index 84f5d8b..5b21207 100644 (file)
@@ -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);
index bfb91f3..840787e 100644 (file)
@@ -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);
index 570cf52..bd5f0d6 100644 (file)
@@ -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);
index 23a9204..e119aaa 100644 (file)
@@ -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);
index 0c84ca0..b6c0997 100644 (file)
@@ -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);
index 57df90d..9902efc 100644 (file)
@@ -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);
index 1807b75..6a2b9f1 100644 (file)
@@ -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);