ASoC: mediatek: Convert to devm_snd_soc_register_card
authorAxel Lin <axel.lin@ingics.com>
Sun, 30 Aug 2015 09:18:50 +0000 (17:18 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 31 Aug 2015 15:11:32 +0000 (16:11 +0100)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Koro Chen <koro.chen@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8173-max98090.c
sound/soc/mediatek/mt8173-rt5650-rt5676.c

index 4d44b5803e55206c02006b9359449df377477b6c..72d66cbed88ddea8829d6175919bd1f60d580b57 100644 (file)
@@ -169,21 +169,13 @@ static int mt8173_max98090_dev_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, "%s snd_soc_register_card fail %d\n",
                        __func__, ret);
        return ret;
 }
 
-static int mt8173_max98090_dev_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static const struct of_device_id mt8173_max98090_dt_match[] = {
        { .compatible = "mediatek,mt8173-max98090", },
        { }
@@ -200,7 +192,6 @@ static struct platform_driver mt8173_max98090_driver = {
 #endif
        },
        .probe = mt8173_max98090_dev_probe,
-       .remove = mt8173_max98090_dev_remove,
 };
 
 module_platform_driver(mt8173_max98090_driver);
index 0940553230596aed2ba41787b8605e26c2cc11c7..bff96e4e8b5d0d5decbaba9f879882634f1c39bd 100644 (file)
@@ -234,21 +234,13 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)
        card->dev = &pdev->dev;
        platform_set_drvdata(pdev, card);
 
-       ret = snd_soc_register_card(card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
        if (ret)
                dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
                        __func__, ret);
        return ret;
 }
 
-static int mt8173_rt5650_rt5676_dev_remove(struct platform_device *pdev)
-{
-       struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-       snd_soc_unregister_card(card);
-       return 0;
-}
-
 static const struct of_device_id mt8173_rt5650_rt5676_dt_match[] = {
        { .compatible = "mediatek,mt8173-rt5650-rt5676", },
        { }
@@ -265,7 +257,6 @@ static struct platform_driver mt8173_rt5650_rt5676_driver = {
 #endif
        },
        .probe = mt8173_rt5650_rt5676_dev_probe,
-       .remove = mt8173_rt5650_rt5676_dev_remove,
 };
 
 module_platform_driver(mt8173_rt5650_rt5676_driver);