OSDN Git Service

ASoC: au1x: psc-i2s.c: use devm_snd_soc_register_component()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 28 Jun 2019 04:08:48 +0000 (13:08 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 2 Jul 2019 12:48:29 +0000 (13:48 +0100)
We have devm_xxx version of snd_soc_register_component,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/au1x/psc-i2s.c

index 4a5a095..076303f 100644 (file)
@@ -340,16 +340,14 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, wd);
 
-       return snd_soc_register_component(&pdev->dev, &au1xpsc_i2s_component,
-                                         &wd->dai_drv, 1);
+       return devm_snd_soc_register_component(&pdev->dev,
+                               &au1xpsc_i2s_component, &wd->dai_drv, 1);
 }
 
 static int au1xpsc_i2s_drvremove(struct platform_device *pdev)
 {
        struct au1xpsc_audio_data *wd = platform_get_drvdata(pdev);
 
-       snd_soc_unregister_component(&pdev->dev);
-
        __raw_writel(0, I2S_CFG(wd));
        wmb(); /* drain writebuffer */
        __raw_writel(PSC_CTRL_DISABLE, PSC_CTRL(wd));