]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/i2c/other/pt2258.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux...
[linux-2.6-omap-h63xx.git] / sound / i2c / other / pt2258.c
index 50df1df2f2b9b9917b2c7afd00de40e0f5af9f27..797d3a6687ebf7557308fd5a1d14201a230e8dbe 100644 (file)
@@ -19,7 +19,6 @@
  *
  */      
 
-#include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/tlv.h>
@@ -113,6 +112,8 @@ static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
 
        val0 = 79 - ucontrol->value.integer.value[0];
        val1 = 79 - ucontrol->value.integer.value[1];
+       if (val0 < 0 || val0 > 79 || val1 < 0 || val1 > 79)
+               return -EINVAL;
        if (val0 == pt->volume[base] && val1 == pt->volume[base + 1])
                return 0;
 
@@ -140,15 +141,7 @@ static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
        return -EIO;
 }
 
-static int pt2258_switch_info(struct snd_kcontrol *kcontrol,
-                             struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 1;
-       return 0;
-}
+#define pt2258_switch_info     snd_ctl_boolean_mono_info
 
 static int pt2258_switch_get(struct snd_kcontrol *kcontrol,
                             struct snd_ctl_elem_value *ucontrol)
@@ -185,7 +178,7 @@ static int pt2258_switch_put(struct snd_kcontrol *kcontrol,
        return -EIO;
 }
 
-static DECLARE_TLV_DB_SCALE(pt2258_db_scale, -7900, 100, 0);
+static const DECLARE_TLV_DB_SCALE(pt2258_db_scale, -7900, 100, 0);
 
 int snd_pt2258_build_controls(struct snd_pt2258 *pt)
 {