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 84f5d8b766791748ca065678d828e767b27f0eb3..5b21207cf551f5ee4b4c4f75d0ba18a71c4d60e4 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 bfb91f34a22a95f0a4c65084e085cc84a6db5349..840787e63cb1847954f87e1da6d07841215b28d6 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 570cf522950824aca76801cce2184291b849821b..bd5f0d643a8637436c9e46ff117882b810ec48c8 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 23a9204b106d66a7e6a64eb8f7dc7f3b5bb2e186..e119aaa91c285d4abf7ca5ed901c9b5026c78212 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 0c84ca0996126b86c28dc9412dbfd08494501c02..b6c09979be1f77120888c017e6ba2e7362c1ef2d 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 57df90d6b7c1bfdedbb5705fc0b2b0fef47d70d4..9902efcb8ea121a99a930816d727c11c1f614258 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 1807b75ccc12d0544d79e538173a2dc47e55ed1a..6a2b9f14d6246dd8382eab01fd30cf9840c81f1e 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);