alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw, enum_virt}()
@ 2013-07-24 13:27 Lars-Peter Clausen
  2013-07-24 13:27 ` [PATCH 2/5] ASoC: dapm: Pass snd_soc_card directly to soc_dpcm_runtime_update() Lars-Peter Clausen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Lars-Peter Clausen @ 2013-07-24 13:27 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Andreas Irestål, alsa-devel, Lars-Peter Clausen,
	Stephen Warren, Hebbar Gururaja

The ALSA core expect the put callback of a control to return 1 if the value of
the control changed and 0 if it did not. Both snd_soc_dapm_put_volsw() and
snd_soc_dapm_put_enum_virt() currently always returns 0. For both functions we
already have a 'change' variable which either contains 1 or 0 depending on
whether the value has changed or not, so just return that.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-dapm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index deb1b3d..4097a55 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2703,7 +2703,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
 	}
 
 	mutex_unlock(&card->dapm_mutex);
-	return 0;
+	return change;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_volsw);
 
@@ -2831,7 +2831,6 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
 	struct soc_enum *e =
 		(struct soc_enum *)kcontrol->private_value;
 	int change;
-	int ret = 0;
 	int wi;
 
 	if (ucontrol->value.enumerated.item[0] >= e->max)
@@ -2851,7 +2850,7 @@ int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol,
 	}
 
 	mutex_unlock(&card->dapm_mutex);
-	return ret;
+	return change;
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_enum_virt);
 
-- 
1.8.0

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

end of thread, other threads:[~2013-07-24 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-24 13:27 [PATCH 1/5] ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw, enum_virt}() Lars-Peter Clausen
2013-07-24 13:27 ` [PATCH 2/5] ASoC: dapm: Pass snd_soc_card directly to soc_dpcm_runtime_update() Lars-Peter Clausen
2013-07-24 13:27 ` [PATCH 3/5] ASoC: dapm: Run widget updates for shared controls at the same time Lars-Peter Clausen
2013-07-24 13:27 ` [PATCH 4/5] ASoC: dapm: Add a update parameter to snd_soc_dapm_{mux, mixer}_update_power Lars-Peter Clausen
2013-07-24 13:27 ` [PATCH 5/5] ASoC: tlv320aic3x: Use snd_soc_dapm_mixer_update_power Lars-Peter Clausen
2013-07-24 13:56 ` [PATCH 1/5] ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw, enum_virt}() Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).