diff mbox series

[4/4] ASoC: amd: don't use snd_soc_rtdcom_lookup()

Message ID 877dy8unvu.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series ASoC:: don't use snd_soc_rtdcom_lookup() | expand

Commit Message

Kuninori Morimoto April 22, 2020, 4:48 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

We shouldn't use snd_soc_rtdcom_lookup() as much as possible.
It works today, but, will not work in the future if we support multi
CPU/Codec/Platform, because 1 rtd might have multiple same driver
named component.

acp3x-pcm-dma driver is using snd_soc_rtdcom_lookup() at
open/close() to get component by using DRV_NAME.

But, lookuped "component" and function parameter "component"
are same. We don't need to use snd_soc_rtdcom_lookup().
This patch fixup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/amd/raven/acp3x-pcm-dma.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index e362f0bc9e46..8a892ade1f40 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -211,14 +211,11 @@  static int acp3x_dma_open(struct snd_soc_component *component,
 			  struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime;
-	struct snd_soc_pcm_runtime *prtd;
 	struct i2s_dev_data *adata;
 	struct i2s_stream_instance *i2s_data;
 	int ret;
 
 	runtime = substream->runtime;
-	prtd = substream->private_data;
-	component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
 	adata = dev_get_drvdata(component->dev);
 	i2s_data = kzalloc(sizeof(*i2s_data), GFP_KERNEL);
 	if (!i2s_data)
@@ -337,11 +334,8 @@  static int acp3x_dma_mmap(struct snd_soc_component *component,
 static int acp3x_dma_close(struct snd_soc_component *component,
 			   struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *prtd;
 	struct i2s_dev_data *adata;
 
-	prtd = substream->private_data;
-	component = snd_soc_rtdcom_lookup(prtd, DRV_NAME);
 	adata = dev_get_drvdata(component->dev);