ASoC: pxa: Convert to devm_snd_soc_register_card
authorAxel Lin <axel.lin@ingics.com>
Tue, 1 Sep 2015 02:32:59 +0000 (10:32 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 14 Sep 2015 17:33:41 +0000 (18:33 +0100)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
13 files changed:
sound/soc/pxa/brownstone.c
sound/soc/pxa/corgi.c
sound/soc/pxa/e740_wm9705.c
sound/soc/pxa/e750_wm9705.c
sound/soc/pxa/e800_wm9712.c
sound/soc/pxa/hx4700.c
sound/soc/pxa/imote2.c
sound/soc/pxa/mioa701_wm9713.c
sound/soc/pxa/palm27x.c
sound/soc/pxa/poodle.c
sound/soc/pxa/spitz.c
sound/soc/pxa/tosa.c
sound/soc/pxa/ttc-dkb.c

index 2b26318bc20097b0c5e369b50f151b7bde511e59..6147e86e9b0fc2f0addc82a2374c7aa3f095bbb8 100644 (file)
@@ -116,26 +116,19 @@ static int brownstone_probe(struct platform_device *pdev)
        int ret;
 
        brownstone.dev = &pdev->dev;
-       ret = snd_soc_register_card(&brownstone);
+       ret = devm_snd_soc_register_card(&pdev->dev, &brownstone);
        if (ret)
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                                ret);
        return ret;
 }
 
-static int brownstone_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_card(&brownstone);
-       return 0;
-}
-
 static struct platform_driver mmp_driver = {
        .driver         = {
                .name   = "brownstone-audio",
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = brownstone_probe,
-       .remove         = brownstone_remove,
 };
 
 module_platform_driver(mmp_driver);
index 3580d10c9f282312056d6ad3952b6adbcf632ffe..c97dc13d36087628433de516a1b2217df02b492b 100644 (file)
@@ -295,28 +295,19 @@ static int corgi_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       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;
 }
 
-static int corgi_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static struct platform_driver corgi_driver = {
        .driver         = {
                .name   = "corgi-audio",
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = corgi_probe,
-       .remove         = corgi_remove,
 };
 
 module_platform_driver(corgi_driver);
index d72e124a3676bf545be9d0afa49e6180973a00b2..1de876529aa128c39f9fc5000dcb371a778849a3 100644 (file)
@@ -138,7 +138,7 @@ static int e740_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -149,10 +149,7 @@ static int e740_probe(struct platform_device *pdev)
 
 static int e740_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
        gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios));
-       snd_soc_unregister_card(card);
        return 0;
 }
 
index 48f2d7c2e68c2621f7cce3c6225a166ae8f0920f..b7eb7cd5df7d0814e4c4abe172215d38d2dd5ab1 100644 (file)
@@ -120,7 +120,7 @@ static int e750_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -131,10 +131,7 @@ static int e750_probe(struct platform_device *pdev)
 
 static int e750_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
        gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
-       snd_soc_unregister_card(card);
        return 0;
 }
 
index 45d4bd46fff60d08dbda013b5e7b8f8cefd1851e..41bf71466a7bb619c06de89e81d4e1b6b731c8fb 100644 (file)
@@ -119,7 +119,7 @@ static int e800_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -130,10 +130,7 @@ static int e800_probe(struct platform_device *pdev)
 
 static int e800_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
        gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios));
-       snd_soc_unregister_card(card);
        return 0;
 }
 
index 9f8be7cd567e48c83218624ddfe2cad538ef28d7..ecbf2873b7ffd8e205ce86fdd7dfa743ebe9435c 100644 (file)
@@ -193,7 +193,7 @@ static int hx4700_audio_probe(struct platform_device *pdev)
                return ret;
 
        snd_soc_card_hx4700.dev = &pdev->dev;
-       ret = snd_soc_register_card(&snd_soc_card_hx4700);
+       ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_hx4700);
        if (ret)
                gpio_free_array(hx4700_audio_gpios,
                                ARRAY_SIZE(hx4700_audio_gpios));
@@ -203,8 +203,6 @@ static int hx4700_audio_probe(struct platform_device *pdev)
 
 static int hx4700_audio_remove(struct platform_device *pdev)
 {
-       snd_soc_unregister_card(&snd_soc_card_hx4700);
-
        gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
        gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);
 
index 29fabbfd21f1796cd91142c0e99d7addfcc5f924..9d0e40771ef5b01de482aeb9daef67c15f30297f 100644 (file)
@@ -72,28 +72,19 @@ static int imote2_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       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;
 }
 
-static int imote2_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static struct platform_driver imote2_driver = {
        .driver         = {
                .name   = "imote2-audio",
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = imote2_probe,
-       .remove         = imote2_remove,
 };
 
 module_platform_driver(imote2_driver);
index a9615a574546988f6fc8e83fe5a018dc05528cba..29bc60e85e92898e585a57202ad2540f4be61cae 100644 (file)
@@ -181,7 +181,7 @@ static int mioa701_wm9713_probe(struct platform_device *pdev)
                return -ENODEV;
 
        mioa701.dev = &pdev->dev;
-       rc =  snd_soc_register_card(&mioa701);
+       rc = devm_snd_soc_register_card(&pdev->dev, &mioa701);
        if (!rc)
                dev_warn(&pdev->dev, "Be warned that incorrect mixers/muxes setup will"
                         "lead to overheating and possible destruction of your device."
@@ -189,17 +189,8 @@ static int mioa701_wm9713_probe(struct platform_device *pdev)
        return rc;
 }
 
-static int mioa701_wm9713_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static struct platform_driver mioa701_wm9713_driver = {
        .probe          = mioa701_wm9713_probe,
-       .remove         = mioa701_wm9713_remove,
        .driver         = {
                .name           = "mioa701-wm9713",
                .pm     = &snd_soc_pm_ops,
index c20bbc042425dacb2a478d247f9087b87ba8469c..4e74d9573f032eb77cb79a05f16cfd3da95e4f5b 100644 (file)
@@ -140,22 +140,15 @@ static int palm27x_asoc_probe(struct platform_device *pdev)
 
        palm27x_asoc.dev = &pdev->dev;
 
-       ret = snd_soc_register_card(&palm27x_asoc);
+       ret = devm_snd_soc_register_card(&pdev->dev, &palm27x_asoc);
        if (ret)
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
        return ret;
 }
 
-static int palm27x_asoc_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_card(&palm27x_asoc);
-       return 0;
-}
-
 static struct platform_driver palm27x_wm9712_driver = {
        .probe          = palm27x_asoc_probe,
-       .remove         = palm27x_asoc_remove,
        .driver         = {
                .name           = "palm27x-asoc",
                .pm     = &snd_soc_pm_ops,
index 80b457ac522acb2c9bdbf1318dfc59bbd36d3789..84d0e2e508088a260b54911bca03236a50046203 100644 (file)
@@ -267,28 +267,19 @@ static int poodle_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       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;
 }
 
-static int poodle_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static struct platform_driver poodle_driver = {
        .driver         = {
                .name   = "poodle-audio",
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = poodle_probe,
-       .remove         = poodle_remove,
 };
 
 module_platform_driver(poodle_driver);
index 461123ad5ff2d4c56e21a97a14e27f8ce7d841c4..b00222620fd01be5cf00d4118d44f18832ad3bdc 100644 (file)
@@ -305,7 +305,7 @@ static int spitz_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -322,9 +322,6 @@ err1:
 
 static int spitz_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
        gpio_free(spitz_mic_gpio);
        return 0;
 }
index f59f566551ef72ad4e0b5c4bb369d1c8b8de7ec0..49518dd642aa18ffd3f0004fe2f425210e820b54 100644 (file)
@@ -233,7 +233,7 @@ static int tosa_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret) {
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -244,10 +244,7 @@ static int tosa_probe(struct platform_device *pdev)
 
 static int tosa_remove(struct platform_device *pdev)
 {
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
        gpio_free(TOSA_GPIO_L_MUTE);
-       snd_soc_unregister_card(card);
        return 0;
 }
 
index 1753c7d9e760e4bfa14e5b5ed8844b530e7413cf..65c20f779177589bcb7eb0ce8d61a2196806eb69 100644 (file)
@@ -128,7 +128,7 @@ static int ttc_dkb_probe(struct platform_device *pdev)
 
        card->dev = &pdev->dev;
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret)
                dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
                        ret);
@@ -136,22 +136,12 @@ static int ttc_dkb_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int ttc_dkb_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-
-       return 0;
-}
-
 static struct platform_driver ttc_dkb_driver = {
        .driver         = {
                .name   = "ttc-dkb-audio",
                .pm     = &snd_soc_pm_ops,
        },
        .probe          = ttc_dkb_probe,
-       .remove         = ttc_dkb_remove,
 };
 
 module_platform_driver(ttc_dkb_driver);