Skip to contentSkip to conversation

ASoC: h1940_uda1380: Don't modify runtime->hw

PATCH Applied Lars-Peter Clausen 3 participants 4 messages Feb 3, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: h1940_uda1380: Don't modify runtime->hw

Individual components are not supposed to modify the runtime->hw struct itself as it is manged by the ASoC core. If a component wants to limit the list of supported rates it should set a rate constraint. The h1940_uda1380 already does this, so it is safe to just remove the code that modifies runtime->hw.

---
 sound/soc/samsung/h1940_uda1380.c | 4 ----
 1 file changed, 4 deletions(-)
sound/soc/samsung/h1940_uda1380.c +0 -4
index ec5cbdd..7a85ce8 100644
@@ -66,10 +66,6 @@ static int h1940_startup(struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
-	runtime->hw.rate_min = hw_rates.list[0];
-	runtime->hw.rate_max = hw_rates.list[hw_rates.count - 1];
-	runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
-
 	return snd_pcm_hw_constraint_list(runtime, 0,
 					SNDRV_PCM_HW_PARAM_RATE,
 					&hw_rates);
Signature · 1 line
1.8.0
#1 lore raw

PATCH 2/2 ASoC: rx1950_uda1380: Don't modify runtime->hw

Individual components are not supposed to modify the runtime->hw struct itself as it is manged by the ASoC core. If a component wants to limit the list of supported rates it should set a rate constraint. The rx1950_uda1380 already does this, so it is safe to just remove the code that modifies runtime->hw.

---
 sound/soc/samsung/rx1950_uda1380.c | 4 ----
 1 file changed, 4 deletions(-)
sound/soc/samsung/rx1950_uda1380.c +0 -4
index f69da8f..2311c88 100644
@@ -131,10 +131,6 @@ static int rx1950_startup(struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
-	runtime->hw.rate_min = hw_rates.list[0];
-	runtime->hw.rate_max = hw_rates.list[hw_rates.count - 1];
-	runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
-
 	return snd_pcm_hw_constraint_list(runtime, 0,
 					SNDRV_PCM_HW_PARAM_RATE,
 					&hw_rates);
Signature · 1 line
1.8.0
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ASoC: rx1950_uda1380: Don't modify runtime->hw

Quoted 6 lines · Lars-Peter Clausen

Individual components are not supposed to modify the runtime->hw struct itself as it is manged by the ASoC core. If a component wants to limit the list of supported rates it should set a rate constraint. The rx1950_uda1380 already does this, so it is safe to just remove the code that modifies runtime->hw.

Both patches looks OK to me.
For both:

Quoted 22 lines
---
 sound/soc/samsung/rx1950_uda1380.c | 4 ----
 1 file changed, 4 deletions(-)
sound/soc/samsung/rx1950_uda1380.c +0 -5
index f69da8f..2311c88 100644
@@ -131,10 +131,6 @@ static int rx1950_startup(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
 
-       runtime->hw.rate_min = hw_rates.list[0];
-       runtime->hw.rate_max = hw_rates.list[hw_rates.count - 1];
-       runtime->hw.rates = SNDRV_PCM_RATE_KNOT;
-
        return snd_pcm_hw_constraint_list(runtime, 0,
                                        SNDRV_PCM_HW_PARAM_RATE,
                                        &hw_rates);
--

1.8.0

maintainer Applied
#3 lore raw
In reply to Lars-Peter Clausen
Quoted 4 lines · Lars-Peter Clausen

Individual components are not supposed to modify the runtime->hw struct itself as it is manged by the ASoC core. If a component wants to limit the list of supported rates it should set a rate constraint. The h1940_uda1380 already does this, so it is safe to just remove the code that modifies runtime->hw.

Applied both, thanks.