Merge remote-tracking branches 'asoc/topic/jz4740', 'asoc/topic/kirkwood', 'asoc...
[firefly-linux-kernel-4.4.55.git] / sound / soc / mediatek / mt8173-max98090.c
index 2d2536af141fc9157b2ecb402a969af6c808faf6..71a1a35047bafd085881efd5369f5275bf9a050f 100644 (file)
@@ -136,6 +136,7 @@ static struct snd_soc_dai_link mt8173_max98090_dais[] = {
 
 static struct snd_soc_card mt8173_max98090_card = {
        .name = "mt8173-max98090",
+       .owner = THIS_MODULE,
        .dai_link = mt8173_max98090_dais,
        .num_links = ARRAY_SIZE(mt8173_max98090_dais),
        .controls = mt8173_max98090_controls,
@@ -178,21 +179,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", },
        { }
@@ -202,14 +195,12 @@ MODULE_DEVICE_TABLE(of, mt8173_max98090_dt_match);
 static struct platform_driver mt8173_max98090_driver = {
        .driver = {
                   .name = "mt8173-max98090",
-                  .owner = THIS_MODULE,
                   .of_match_table = mt8173_max98090_dt_match,
 #ifdef CONFIG_PM
                   .pm = &snd_soc_pm_ops,
 #endif
        },
        .probe = mt8173_max98090_dev_probe,
-       .remove = mt8173_max98090_dev_remove,
 };
 
 module_platform_driver(mt8173_max98090_driver);