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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
 sound/soc/amd/raven/acp3x-pcm-dma.c | 6 ------
 1 file changed, 6 deletions(-)

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);
 
 
-- 
2.17.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux