ASoC: fsl: Use devm_snd_dmaengine_pcm_register()
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 28 Nov 2013 07:50:35 +0000 (08:50 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 2 Dec 2013 11:48:54 +0000 (11:48 +0000)
Makes the code shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/fsl/fsl_spdif.c
sound/soc/fsl/fsl_ssi.c
sound/soc/fsl/imx-pcm-dma.c
sound/soc/fsl/imx-pcm.h
sound/soc/fsl/imx-ssi.c

index 55193a5596ca6fe4aa3b0c53170d71f4f1a6c355..4d075f1abe7803387bb01dbb39a2d66a0eac4c59 100644 (file)
@@ -1181,13 +1181,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
        return ret;
 }
 
-static int fsl_spdif_remove(struct platform_device *pdev)
-{
-       imx_pcm_dma_exit(pdev);
-
-       return 0;
-}
-
 static const struct of_device_id fsl_spdif_dt_ids[] = {
        { .compatible = "fsl,imx35-spdif", },
        {}
@@ -1201,7 +1194,6 @@ static struct platform_driver fsl_spdif_driver = {
                .of_match_table = fsl_spdif_dt_ids,
        },
        .probe = fsl_spdif_probe,
-       .remove = fsl_spdif_remove,
 };
 
 module_platform_driver(fsl_spdif_driver);
index fb8f52a0e7b7a8fd262c58f33891b5a9c361a71b..3df0318e71df29cc67424d2e627c2e8d8a955fcf 100644 (file)
@@ -1109,8 +1109,6 @@ done:
        return 0;
 
 error_dai:
-       if (ssi_private->ssi_on_imx)
-               imx_pcm_dma_exit(pdev);
        snd_soc_unregister_component(&pdev->dev);
 
 error_dev:
@@ -1132,8 +1130,6 @@ static int fsl_ssi_remove(struct platform_device *pdev)
 
        if (!ssi_private->new_binding)
                platform_device_unregister(ssi_private->pdev);
-       if (ssi_private->ssi_on_imx)
-               imx_pcm_dma_exit(pdev);
        snd_soc_unregister_component(&pdev->dev);
        device_remove_file(&pdev->dev, &ssi_private->dev_attr);
        if (ssi_private->ssi_on_imx)
index aee23077080a219983f0dd52764d1aa4199cb15c..c5e47f866b4b756beaa515b1c29ba4177572cb10 100644 (file)
@@ -61,16 +61,11 @@ static const struct snd_dmaengine_pcm_config imx_dmaengine_pcm_config = {
 
 int imx_pcm_dma_init(struct platform_device *pdev)
 {
-       return snd_dmaengine_pcm_register(&pdev->dev, &imx_dmaengine_pcm_config,
+       return devm_snd_dmaengine_pcm_register(&pdev->dev,
+               &imx_dmaengine_pcm_config,
                SND_DMAENGINE_PCM_FLAG_NO_RESIDUE |
                SND_DMAENGINE_PCM_FLAG_COMPAT);
 }
 EXPORT_SYMBOL_GPL(imx_pcm_dma_init);
 
-void imx_pcm_dma_exit(struct platform_device *pdev)
-{
-       snd_dmaengine_pcm_unregister(&pdev->dev);
-}
-EXPORT_SYMBOL_GPL(imx_pcm_dma_exit);
-
 MODULE_LICENSE("GPL");
index 5d5b73303e1169b7f6c2254e06d66a87409050cc..c79cb27473be771d9ee355cacf52229f5da6c40d 100644 (file)
@@ -40,16 +40,11 @@ struct imx_pcm_fiq_params {
 
 #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA)
 int imx_pcm_dma_init(struct platform_device *pdev);
-void imx_pcm_dma_exit(struct platform_device *pdev);
 #else
 static inline int imx_pcm_dma_init(struct platform_device *pdev)
 {
        return -ENODEV;
 }
-
-static inline void imx_pcm_dma_exit(struct platform_device *pdev)
-{
-}
 #endif
 
 #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ)
index f5f248c91c16db7c3db5a50654bceedb0e81953f..cc7376f87f888b5db47d70d84826fb7e426d7863 100644 (file)
@@ -624,9 +624,6 @@ static int imx_ssi_remove(struct platform_device *pdev)
 {
        struct imx_ssi *ssi = platform_get_drvdata(pdev);
 
-       if (!ssi->dma_init)
-               imx_pcm_dma_exit(pdev);
-
        if (!ssi->fiq_init)
                imx_pcm_fiq_exit(pdev);