diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-11-28 02:50:35 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-02 06:48:54 -0500 |
commit | 7e6d18ac7ea1372b462778ff7c416ceaabe71b66 (patch) | |
tree | a9a969c8f2d201197f96e2c5f493cfdf430f8a62 | |
parent | 75ab73bc5d0e625e9d886653ec98d0e9d6ad4c68 (diff) |
ASoC: fsl: Use devm_snd_dmaengine_pcm_register()
Makes the code shorter.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 8 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 4 | ||||
-rw-r--r-- | sound/soc/fsl/imx-pcm-dma.c | 9 | ||||
-rw-r--r-- | sound/soc/fsl/imx-pcm.h | 5 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 3 |
5 files changed, 2 insertions, 27 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 55193a5596ca..4d075f1abe78 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c | |||
@@ -1181,13 +1181,6 @@ static int fsl_spdif_probe(struct platform_device *pdev) | |||
1181 | return ret; | 1181 | return ret; |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | static int fsl_spdif_remove(struct platform_device *pdev) | ||
1185 | { | ||
1186 | imx_pcm_dma_exit(pdev); | ||
1187 | |||
1188 | return 0; | ||
1189 | } | ||
1190 | |||
1191 | static const struct of_device_id fsl_spdif_dt_ids[] = { | 1184 | static const struct of_device_id fsl_spdif_dt_ids[] = { |
1192 | { .compatible = "fsl,imx35-spdif", }, | 1185 | { .compatible = "fsl,imx35-spdif", }, |
1193 | {} | 1186 | {} |
@@ -1201,7 +1194,6 @@ static struct platform_driver fsl_spdif_driver = { | |||
1201 | .of_match_table = fsl_spdif_dt_ids, | 1194 | .of_match_table = fsl_spdif_dt_ids, |
1202 | }, | 1195 | }, |
1203 | .probe = fsl_spdif_probe, | 1196 | .probe = fsl_spdif_probe, |
1204 | .remove = fsl_spdif_remove, | ||
1205 | }; | 1197 | }; |
1206 | 1198 | ||
1207 | module_platform_driver(fsl_spdif_driver); | 1199 | module_platform_driver(fsl_spdif_driver); |
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index fb8f52a0e7b7..3df0318e71df 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -1109,8 +1109,6 @@ done: | |||
1109 | return 0; | 1109 | return 0; |
1110 | 1110 | ||
1111 | error_dai: | 1111 | error_dai: |
1112 | if (ssi_private->ssi_on_imx) | ||
1113 | imx_pcm_dma_exit(pdev); | ||
1114 | snd_soc_unregister_component(&pdev->dev); | 1112 | snd_soc_unregister_component(&pdev->dev); |
1115 | 1113 | ||
1116 | error_dev: | 1114 | error_dev: |
@@ -1132,8 +1130,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
1132 | 1130 | ||
1133 | if (!ssi_private->new_binding) | 1131 | if (!ssi_private->new_binding) |
1134 | platform_device_unregister(ssi_private->pdev); | 1132 | platform_device_unregister(ssi_private->pdev); |
1135 | if (ssi_private->ssi_on_imx) | ||
1136 | imx_pcm_dma_exit(pdev); | ||
1137 | snd_soc_unregister_component(&pdev->dev); | 1133 | snd_soc_unregister_component(&pdev->dev); |
1138 | device_remove_file(&pdev->dev, &ssi_private->dev_attr); | 1134 | device_remove_file(&pdev->dev, &ssi_private->dev_attr); |
1139 | if (ssi_private->ssi_on_imx) | 1135 | if (ssi_private->ssi_on_imx) |
diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index aee23077080a..c5e47f866b4b 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c | |||
@@ -61,16 +61,11 @@ static const struct snd_dmaengine_pcm_config imx_dmaengine_pcm_config = { | |||
61 | 61 | ||
62 | int imx_pcm_dma_init(struct platform_device *pdev) | 62 | int imx_pcm_dma_init(struct platform_device *pdev) |
63 | { | 63 | { |
64 | return snd_dmaengine_pcm_register(&pdev->dev, &imx_dmaengine_pcm_config, | 64 | return devm_snd_dmaengine_pcm_register(&pdev->dev, |
65 | &imx_dmaengine_pcm_config, | ||
65 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | | 66 | SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | |
66 | SND_DMAENGINE_PCM_FLAG_COMPAT); | 67 | SND_DMAENGINE_PCM_FLAG_COMPAT); |
67 | } | 68 | } |
68 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); | 69 | EXPORT_SYMBOL_GPL(imx_pcm_dma_init); |
69 | 70 | ||
70 | void imx_pcm_dma_exit(struct platform_device *pdev) | ||
71 | { | ||
72 | snd_dmaengine_pcm_unregister(&pdev->dev); | ||
73 | } | ||
74 | EXPORT_SYMBOL_GPL(imx_pcm_dma_exit); | ||
75 | |||
76 | MODULE_LICENSE("GPL"); | 71 | MODULE_LICENSE("GPL"); |
diff --git a/sound/soc/fsl/imx-pcm.h b/sound/soc/fsl/imx-pcm.h index 5d5b73303e11..c79cb27473be 100644 --- a/sound/soc/fsl/imx-pcm.h +++ b/sound/soc/fsl/imx-pcm.h | |||
@@ -40,16 +40,11 @@ struct imx_pcm_fiq_params { | |||
40 | 40 | ||
41 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA) | 41 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA) |
42 | int imx_pcm_dma_init(struct platform_device *pdev); | 42 | int imx_pcm_dma_init(struct platform_device *pdev); |
43 | void imx_pcm_dma_exit(struct platform_device *pdev); | ||
44 | #else | 43 | #else |
45 | static inline int imx_pcm_dma_init(struct platform_device *pdev) | 44 | static inline int imx_pcm_dma_init(struct platform_device *pdev) |
46 | { | 45 | { |
47 | return -ENODEV; | 46 | return -ENODEV; |
48 | } | 47 | } |
49 | |||
50 | static inline void imx_pcm_dma_exit(struct platform_device *pdev) | ||
51 | { | ||
52 | } | ||
53 | #endif | 48 | #endif |
54 | 49 | ||
55 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ) | 50 | #if IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_FIQ) |
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index f5f248c91c16..cc7376f87f88 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -624,9 +624,6 @@ static int imx_ssi_remove(struct platform_device *pdev) | |||
624 | { | 624 | { |
625 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 625 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
626 | 626 | ||
627 | if (!ssi->dma_init) | ||
628 | imx_pcm_dma_exit(pdev); | ||
629 | |||
630 | if (!ssi->fiq_init) | 627 | if (!ssi->fiq_init) |
631 | imx_pcm_fiq_exit(pdev); | 628 | imx_pcm_fiq_exit(pdev); |
632 | 629 | ||