staging: greybus: audio: Avoid less than zero check for le32 variable
authorVaibhav Agarwal <vaibhav.sr@gmail.com>
Wed, 18 Jan 2017 17:21:50 +0000 (22:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 10:08:00 +0000 (11:08 +0100)
mixer control->info call back function checks for -ve values to rebase
min and max values. However, le32 variable is used to fetch values from
GB module FW. Thus negative value checking is not required. Fix this!!

Signed-off-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/audio_topology.c

index 3001a4971c06da6fac451c4916b62d70227b6912..ee2113eb899e2f8e17f5f2bafb2695c0b9d3e96b 100644 (file)
@@ -371,12 +371,8 @@ static int gbcodec_mixer_dapm_ctl_info(struct snd_kcontrol *kcontrol,
                uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
 
        uinfo->count = data->vcount;
-       uinfo->value.integer.min = 0;
-       if (info->value.integer.min < 0 &&
-           (uinfo->type == SNDRV_CTL_ELEM_TYPE_INTEGER))
-               uinfo->value.integer.max = platform_max - platform_min;
-       else
-               uinfo->value.integer.max = platform_max;
+       uinfo->value.integer.min = platform_min;
+       uinfo->value.integer.max = platform_max;
 
        return 0;
 }