]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: hisilicon: Use devm_snd_soc_register_component
authorJohn Stultz <john.stultz@linaro.org>
Tue, 11 Apr 2017 19:15:18 +0000 (12:15 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 11 Apr 2017 20:20:55 +0000 (21:20 +0100)
Per feedback from Mark Brown, this patch updates the hi6210-i2s
driver to use devm_snd_soc_register_component which simplifies
the logic a bit.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/hisilicon/hi6210-i2s.c

index 27553dca7cc6abfb7f152f8ff353b3199b050da6..45163e5202f546faec545fb65fd0e60b1decc74b 100644 (file)
@@ -591,22 +591,9 @@ static int hi6210_i2s_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       ret = snd_soc_register_component(&pdev->dev, &hi6210_i2s_i2s_comp,
+       ret = devm_snd_soc_register_component(&pdev->dev, &hi6210_i2s_i2s_comp,
                                         &i2s->dai, 1);
-       if (ret) {
-               dev_err(&pdev->dev, "Failed to register dai\n");
-               return ret;
-       }
-
-       return 0;
-}
-
-static int hi6210_i2s_remove(struct platform_device *pdev)
-{
-       snd_soc_unregister_component(&pdev->dev);
-       dev_set_drvdata(&pdev->dev, NULL);
-
-       return 0;
+       return ret;
 }
 
 static const struct of_device_id hi6210_i2s_dt_ids[] = {
@@ -618,7 +605,6 @@ MODULE_DEVICE_TABLE(of, hi6210_i2s_dt_ids);
 
 static struct platform_driver hi6210_i2s_driver = {
        .probe = hi6210_i2s_probe,
-       .remove = hi6210_i2s_remove,
        .driver = {
                .name = "hi6210_i2s",
                .of_match_table = hi6210_i2s_dt_ids,