[2/3] ASoC: ti: remove compat dma probing
diff mbox series

Message ID 20190304203114.1894822-2-arnd@arndb.de
State New
Headers show
Series
  • [1/3] ASoC: ti: fix davinci_mcasp_probe dependencies
Related show

Commit Message

Arnd Bergmann March 4, 2019, 8:30 p.m. UTC
After running into a link error:

sound/soc/ti/edma-pcm.o:(.rodata+0x18): undefined reference to `edma_filter_fn'

I checked all users of this, and they have new-style 'dma_slave_map' tables,
so none of them should still need it. Removing the associated lines
simplifies the code and avoids the build-time dependency on the
respective dmaengine drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/ti/edma-pcm.c | 4 +---
 sound/soc/ti/sdma-pcm.c | 8 +++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

Comments

Peter Ujfalusi March 7, 2019, 1:23 p.m. UTC | #1
Hi Arnd,

On 04/03/2019 22.30, Arnd Bergmann wrote:
> After running into a link error:
> 
> sound/soc/ti/edma-pcm.o:(.rodata+0x18): undefined reference to `edma_filter_fn'
> 
> I checked all users of this, and they have new-style 'dma_slave_map' tables,
> so none of them should still need it. Removing the associated lines
> simplifies the code and avoids the build-time dependency on the
> respective dmaengine drivers.

Thank you for the patch!

Yes, I believe I have covered all possible legacy uses for both edma and
sdma with dma_slave_map

With the two comments addressed:
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  sound/soc/ti/edma-pcm.c | 4 +---
>  sound/soc/ti/sdma-pcm.c | 8 +++-----
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/sound/soc/ti/edma-pcm.c b/sound/soc/ti/edma-pcm.c
> index 59e588abe54b..5b9e341309f0 100644
> --- a/sound/soc/ti/edma-pcm.c
> +++ b/sound/soc/ti/edma-pcm.c
> @@ -43,14 +43,12 @@ static const struct snd_pcm_hardware edma_pcm_hardware = {
>  static const struct snd_dmaengine_pcm_config edma_dmaengine_pcm_config = {
>  	.pcm_hardware = &edma_pcm_hardware,
>  	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
> -	.compat_filter_fn = edma_filter_fn,

We can also remove the
#include <linux/edma.h>

as it is no longer needed.

>  	.prealloc_buffer_size = 128 * 1024,
>  };
>  
>  int edma_pcm_platform_register(struct device *dev)
>  {
> -	return devm_snd_dmaengine_pcm_register(dev, &edma_dmaengine_pcm_config,
> -					SND_DMAENGINE_PCM_FLAG_COMPAT);
> +	return devm_snd_dmaengine_pcm_register(dev, &edma_dmaengine_pcm_config, 0);
>  }
>  EXPORT_SYMBOL_GPL(edma_pcm_platform_register);
>  
> diff --git a/sound/soc/ti/sdma-pcm.c b/sound/soc/ti/sdma-pcm.c
> index 21a9c2499d48..3e83a3920dc7 100644
> --- a/sound/soc/ti/sdma-pcm.c
> +++ b/sound/soc/ti/sdma-pcm.c
> @@ -31,7 +31,6 @@ static const struct snd_pcm_hardware sdma_pcm_hardware = {
>  static const struct snd_dmaengine_pcm_config sdma_dmaengine_pcm_config = {
>  	.pcm_hardware = &sdma_pcm_hardware,
>  	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
> -	.compat_filter_fn = omap_dma_filter_fn,

Here we can remove the
#include <linux/omap-dmaengine.h>

>  	.prealloc_buffer_size = 128 * 1024,
>  };
>  
> @@ -39,13 +38,12 @@ int sdma_pcm_platform_register(struct device *dev,
>  			       char *txdmachan, char *rxdmachan)
>  {
>  	struct snd_dmaengine_pcm_config *config;
> -	unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT;
> +	unsigned int flags = 0;
>  
>  	/* Standard names for the directions: 'tx' and 'rx' */
>  	if (!txdmachan && !rxdmachan)
>  		return devm_snd_dmaengine_pcm_register(dev,
> -						&sdma_dmaengine_pcm_config,
> -						flags);
> +						&sdma_dmaengine_pcm_config, 0);
>  
>  	config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL);
>  	if (!config)
> @@ -65,7 +63,7 @@ int sdma_pcm_platform_register(struct device *dev,
>  	config->chan_names[0] = txdmachan;
>  	config->chan_names[1] = rxdmachan;
>  
> -	return devm_snd_dmaengine_pcm_register(dev, config, flags);
> +	return devm_snd_dmaengine_pcm_register(dev, config, 0);
>  }
>  EXPORT_SYMBOL_GPL(sdma_pcm_platform_register);
>  
> 

- P├ęter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Arnd Bergmann March 7, 2019, 3:12 p.m. UTC | #2
On Thu, Mar 7, 2019 at 2:22 PM Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>
> Hi Arnd,
>
> On 04/03/2019 22.30, Arnd Bergmann wrote:
> > After running into a link error:
> >
> > sound/soc/ti/edma-pcm.o:(.rodata+0x18): undefined reference to `edma_filter_fn'
> >
> > I checked all users of this, and they have new-style 'dma_slave_map' tables,
> > so none of them should still need it. Removing the associated lines
> > simplifies the code and avoids the build-time dependency on the
> > respective dmaengine drivers.
>
> Thank you for the patch!
>
> Yes, I believe I have covered all possible legacy uses for both edma and
> sdma with dma_slave_map
>
> With the two comments addressed:
> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Thanks!

> > @@ -43,14 +43,12 @@ static const struct snd_pcm_hardware edma_pcm_hardware = {
> >  static const struct snd_dmaengine_pcm_config edma_dmaengine_pcm_config = {
> >       .pcm_hardware = &edma_pcm_hardware,
> >       .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
> > -     .compat_filter_fn = edma_filter_fn,
>
> We can also remove the
> #include <linux/edma.h>
>
> as it is no longer needed.

> Here we can remove the
> #include <linux/omap-dmaengine.h>

Ah, perfect!

I also see that linux/edma.h can be completely removed afterwards, and the
filter function made static. linux/omap-dmaengine.h too, but it is included
from linux/omap.h, of which at least parts are still needed for omap_udc.c

       Arnd

Patch
diff mbox series

diff --git a/sound/soc/ti/edma-pcm.c b/sound/soc/ti/edma-pcm.c
index 59e588abe54b..5b9e341309f0 100644
--- a/sound/soc/ti/edma-pcm.c
+++ b/sound/soc/ti/edma-pcm.c
@@ -43,14 +43,12 @@  static const struct snd_pcm_hardware edma_pcm_hardware = {
 static const struct snd_dmaengine_pcm_config edma_dmaengine_pcm_config = {
 	.pcm_hardware = &edma_pcm_hardware,
 	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
-	.compat_filter_fn = edma_filter_fn,
 	.prealloc_buffer_size = 128 * 1024,
 };
 
 int edma_pcm_platform_register(struct device *dev)
 {
-	return devm_snd_dmaengine_pcm_register(dev, &edma_dmaengine_pcm_config,
-					SND_DMAENGINE_PCM_FLAG_COMPAT);
+	return devm_snd_dmaengine_pcm_register(dev, &edma_dmaengine_pcm_config, 0);
 }
 EXPORT_SYMBOL_GPL(edma_pcm_platform_register);
 
diff --git a/sound/soc/ti/sdma-pcm.c b/sound/soc/ti/sdma-pcm.c
index 21a9c2499d48..3e83a3920dc7 100644
--- a/sound/soc/ti/sdma-pcm.c
+++ b/sound/soc/ti/sdma-pcm.c
@@ -31,7 +31,6 @@  static const struct snd_pcm_hardware sdma_pcm_hardware = {
 static const struct snd_dmaengine_pcm_config sdma_dmaengine_pcm_config = {
 	.pcm_hardware = &sdma_pcm_hardware,
 	.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
-	.compat_filter_fn = omap_dma_filter_fn,
 	.prealloc_buffer_size = 128 * 1024,
 };
 
@@ -39,13 +38,12 @@  int sdma_pcm_platform_register(struct device *dev,
 			       char *txdmachan, char *rxdmachan)
 {
 	struct snd_dmaengine_pcm_config *config;
-	unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT;
+	unsigned int flags = 0;
 
 	/* Standard names for the directions: 'tx' and 'rx' */
 	if (!txdmachan && !rxdmachan)
 		return devm_snd_dmaengine_pcm_register(dev,
-						&sdma_dmaengine_pcm_config,
-						flags);
+						&sdma_dmaengine_pcm_config, 0);
 
 	config = devm_kzalloc(dev, sizeof(*config), GFP_KERNEL);
 	if (!config)
@@ -65,7 +63,7 @@  int sdma_pcm_platform_register(struct device *dev,
 	config->chan_names[0] = txdmachan;
 	config->chan_names[1] = rxdmachan;
 
-	return devm_snd_dmaengine_pcm_register(dev, config, flags);
+	return devm_snd_dmaengine_pcm_register(dev, config, 0);
 }
 EXPORT_SYMBOL_GPL(sdma_pcm_platform_register);