Message ID | 1400492508-2732-3-git-send-email-lars@metafoo.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 2896b8b4d8f3feaca9c09f7a15e86f8c8b32d7dc |
Headers | show |
On 05/19/2014 12:41 PM, Lars-Peter Clausen wrote: > No need to go via the CODEC to get a pointer to the card. This will help to > eventually remove the card field from the snd_soc_codec struct. > > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> > --- > sound/soc/davinci/davinci-evm.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c > index cab98a5..a50010e 100644 > --- a/sound/soc/davinci/davinci-evm.c > +++ b/sound/soc/davinci/davinci-evm.c > @@ -38,7 +38,7 @@ struct snd_soc_card_drvdata_davinci { > static int evm_startup(struct snd_pcm_substream *substream) > { > struct snd_soc_pcm_runtime *rtd = substream->private_data; > - struct snd_soc_card *soc_card = rtd->codec->card; > + struct snd_soc_card *soc_card = rtd->card; > struct snd_soc_card_drvdata_davinci *drvdata = > snd_soc_card_get_drvdata(soc_card); > > @@ -51,7 +51,7 @@ static int evm_startup(struct snd_pcm_substream *substream) > static void evm_shutdown(struct snd_pcm_substream *substream) > { > struct snd_soc_pcm_runtime *rtd = substream->private_data; > - struct snd_soc_card *soc_card = rtd->codec->card; > + struct snd_soc_card *soc_card = rtd->card; > struct snd_soc_card_drvdata_davinci *drvdata = > snd_soc_card_get_drvdata(soc_card); > > @@ -65,8 +65,7 @@ static int evm_hw_params(struct snd_pcm_substream *substream, > struct snd_soc_pcm_runtime *rtd = substream->private_data; > struct snd_soc_dai *codec_dai = rtd->codec_dai; > struct snd_soc_dai *cpu_dai = rtd->cpu_dai; > - struct snd_soc_codec *codec = rtd->codec; > - struct snd_soc_card *soc_card = codec->card; > + struct snd_soc_card *soc_card = rtd->card; > int ret = 0; > unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *) > snd_soc_card_get_drvdata(soc_card))->sysclk; > @@ -125,7 +124,7 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) > { > struct snd_soc_card *card = rtd->card; > struct snd_soc_codec *codec = rtd->codec; > - struct device_node *np = codec->card->dev->of_node; > + struct device_node *np = card->dev->of_node; > int ret; > > /* Add davinci-evm specific widgets */ >
On Mon, May 19, 2014 at 11:41:47AM +0200, Lars-Peter Clausen wrote: > No need to go via the CODEC to get a pointer to the card. This will help to > eventually remove the card field from the snd_soc_codec struct. Applied, thanks.
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index cab98a5..a50010e 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c @@ -38,7 +38,7 @@ struct snd_soc_card_drvdata_davinci { static int evm_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_card *soc_card = rtd->codec->card; + struct snd_soc_card *soc_card = rtd->card; struct snd_soc_card_drvdata_davinci *drvdata = snd_soc_card_get_drvdata(soc_card); @@ -51,7 +51,7 @@ static int evm_startup(struct snd_pcm_substream *substream) static void evm_shutdown(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_card *soc_card = rtd->codec->card; + struct snd_soc_card *soc_card = rtd->card; struct snd_soc_card_drvdata_davinci *drvdata = snd_soc_card_get_drvdata(soc_card); @@ -65,8 +65,7 @@ static int evm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - struct snd_soc_codec *codec = rtd->codec; - struct snd_soc_card *soc_card = codec->card; + struct snd_soc_card *soc_card = rtd->card; int ret = 0; unsigned sysclk = ((struct snd_soc_card_drvdata_davinci *) snd_soc_card_get_drvdata(soc_card))->sysclk; @@ -125,7 +124,7 @@ static int evm_aic3x_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; struct snd_soc_codec *codec = rtd->codec; - struct device_node *np = codec->card->dev->of_node; + struct device_node *np = card->dev->of_node; int ret; /* Add davinci-evm specific widgets */
No need to go via the CODEC to get a pointer to the card. This will help to eventually remove the card field from the snd_soc_codec struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> --- sound/soc/davinci/davinci-evm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)