All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: ac97: Fix build due to removal of 'runtime' definition
@ 2012-04-10 22:38 Fabio Estevam
  2012-04-10 22:38 ` [PATCH 2/2] ASoC: wm9705: " Fabio Estevam
  2012-04-11 10:43 ` [PATCH 1/2] ASoC: ac97: " Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2012-04-10 22:38 UTC (permalink / raw)
  To: alsa-devel; +Cc: Fabio Estevam, broonie, Fabio Estevam

Fix the following build error:

sound/soc/codecs/ac97.c: In function 'ac97_prepare':
sound/soc/codecs/ac97.c:33: error: 'runtime' undeclared (first use in this function)

This was caused by commit e6968a (ASoC: codecs: Remove rtd->codec usage from CODEC drivers),
which removed the 'struct snd_pcm_runtime *runtime = substream->runtime' definition.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/codecs/ac97.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index a99a1b3..2023c74 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -30,7 +30,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
 
 	int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
 		  AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
-	return snd_ac97_set_rate(codec->ac97, reg, runtime->rate);
+	return snd_ac97_set_rate(codec->ac97, reg, substream->runtime->rate);
 }
 
 #define STD_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: wm9705: Fix build due to removal of 'runtime' definition
  2012-04-10 22:38 [PATCH 1/2] ASoC: ac97: Fix build due to removal of 'runtime' definition Fabio Estevam
@ 2012-04-10 22:38 ` Fabio Estevam
  2012-04-11 10:43 ` [PATCH 1/2] ASoC: ac97: " Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2012-04-10 22:38 UTC (permalink / raw)
  To: alsa-devel; +Cc: Fabio Estevam, broonie, Fabio Estevam

sound/soc/codecs/wm9705.c: In function 'ac97_prepare':
sound/soc/codecs/wm9705.c:251: error: 'runtime' undeclared (first use in this function)

This was caused by commit e6968a (ASoC: codecs: Remove rtd->codec usage from CODEC drivers),
which removed the 'struct snd_pcm_runtime *runtime = substream->runtime' definition.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/codecs/wm9705.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 7c09593..e8e782a 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -248,7 +248,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
 	else
 		reg = AC97_PCM_LR_ADC_RATE;
 
-	return ac97_write(codec, reg, runtime->rate);
+	return ac97_write(codec, reg, substream->runtime->rate);
 }
 
 #define WM9705_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ASoC: ac97: Fix build due to removal of 'runtime' definition
  2012-04-10 22:38 [PATCH 1/2] ASoC: ac97: Fix build due to removal of 'runtime' definition Fabio Estevam
  2012-04-10 22:38 ` [PATCH 2/2] ASoC: wm9705: " Fabio Estevam
@ 2012-04-11 10:43 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-04-11 10:43 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel


[-- Attachment #1.1: Type: text/plain, Size: 994 bytes --]

On Tue, Apr 10, 2012 at 07:38:23PM -0300, Fabio Estevam wrote:

> This was caused by commit e6968a (ASoC: codecs: Remove rtd->codec usage from CODEC drivers),
> which removed the 'struct snd_pcm_runtime *runtime = substream->runtime' definition.

You're missing what I was saying the other day.  What I was looking for
here was something more like "commit e6968a was intended to remove uses
of substream->runtime purely to find the CODEC pointer in order to
support CODEC<->CODEC links but in these cases we're actually using data
directly in the runtime so the removal shouldn't have been done here" -
the thing is to explain what the change did wrong and why this is a good
fix for that.  Sometimes this is just that there was a typo but in cases
like this where the initial thought would be "why are we not removing
uses of runtime?" it makes it much easier to see why the fix is good.

It'd also have been good to just re-add the declaration of runtime here.

Anyway, applied both, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-11 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-10 22:38 [PATCH 1/2] ASoC: ac97: Fix build due to removal of 'runtime' definition Fabio Estevam
2012-04-10 22:38 ` [PATCH 2/2] ASoC: wm9705: " Fabio Estevam
2012-04-11 10:43 ` [PATCH 1/2] ASoC: ac97: " Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.