summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-07 03:21:47 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-07 03:21:46 -0700
commitf1bc20623679ced6ae61af71f4aa6c84d517ae28 (patch)
treed5e29e9dc5f234ca7b4e9e26f97eb8722059d18c
parent73ae7e2aaf88f448361d8a3d7b9f2837e2a96327 (diff)
parentc9b0b7c45da36132070ba6a00a6922f528a7c614 (diff)
Merge "ASoC: sound: soc: fix incorrect max value"
-rw-r--r--sound/soc/soc-ops.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index b2dd69055927..c48d8c8d9766 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -201,7 +201,7 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
uinfo->value.integer.min = 0;
- if (mc->min < 0 && (uinfo->type == SNDRV_CTL_ELEM_TYPE_INTEGER))
+ if (uinfo->type == SNDRV_CTL_ELEM_TYPE_INTEGER)
uinfo->value.integer.max = platform_max - mc->min;
else
uinfo->value.integer.max = platform_max;
@@ -224,14 +224,12 @@ EXPORT_SYMBOL_GPL(snd_soc_info_volsw);
int snd_soc_info_volsw_sx(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
- struct soc_mixer_control *mc =
- (struct soc_mixer_control *)kcontrol->private_value;
-
snd_soc_info_volsw(kcontrol, uinfo);
/* Max represents the number of levels in an SX control not the
- * maximum value, so add the minimum value back on
+ * maximum value.
+ * uinfo->value.integer.max is set to number of levels
+ * in snd_soc_info_volsw_sx. No further adjustment is necessary.
*/
- uinfo->value.integer.max += mc->min;
return 0;
}