From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: "Andreas Irestål" <Andreas.Irestal@axis.com>,
alsa-devel@alsa-project.org,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Stephen Warren" <swarren@nvidia.com>,
"Hebbar Gururaja" <gururaja.hebbar@ti.com>
Subject: [PATCH 1/5] ASoC: dapm: Fix return value of snd_soc_dapm_put_{volsw, enum_virt}()
Date: Wed, 24 Jul 2013 15:27:35 +0200 [thread overview]
Message-ID: <1374672459-5202-1-git-send-email-lars@metafoo.de> (raw)
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
next reply other threads:[~2013-07-24 13:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 13:27 Lars-Peter Clausen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374672459-5202-1-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=Andreas.Irestal@axis.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=gururaja.hebbar@ti.com \
--cc=lgirdwood@gmail.com \
--cc=swarren@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).