aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r--sound/pci/ice1712/ak4xxx.c3
-rw-r--r--sound/pci/ice1712/ews.c9
-rw-r--r--sound/pci/ice1712/ice1712.c3
-rw-r--r--sound/pci/ice1712/ice1724.c3
-rw-r--r--sound/pci/ice1712/juli.c3
5 files changed, 14 insertions, 7 deletions
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c
index dab31b2756a6..03391da8c8c7 100644
--- a/sound/pci/ice1712/ak4xxx.c
+++ b/sound/pci/ice1712/ak4xxx.c
@@ -59,7 +59,8 @@ static void snd_ice1712_akm4xxx_write(struct snd_akm4xxx *ak, int chip,
59 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0]; 59 struct snd_ak4xxx_private *priv = (void *)ak->private_value[0];
60 struct snd_ice1712 *ice = ak->private_data[0]; 60 struct snd_ice1712 *ice = ak->private_data[0];
61 61
62 snd_assert(chip >= 0 && chip < 4, return); 62 if (snd_BUG_ON(chip < 0 || chip >= 4))
63 return;
63 64
64 tmp = snd_ice1712_gpio_read(ice); 65 tmp = snd_ice1712_gpio_read(ice);
65 tmp |= priv->add_flags; 66 tmp |= priv->add_flags;
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 013fc4f04822..6fe35b812040 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -149,7 +149,8 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas
149 struct ews_spec *spec = ice->spec; 149 struct ews_spec *spec = ice->spec;
150 unsigned char data, ndata; 150 unsigned char data, ndata;
151 151
152 snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL); 152 if (snd_BUG_ON(chip_mask < 0 || chip_mask > 0x0f))
153 return -EINVAL;
153 snd_i2c_lock(ice->i2c); 154 snd_i2c_lock(ice->i2c);
154 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF2], &data, 1) != 1) 155 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF2], &data, 1) != 1)
155 goto __error; 156 goto __error;
@@ -685,7 +686,8 @@ static int snd_ice1712_ews88mt_input_sense_get(struct snd_kcontrol *kcontrol, st
685 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 686 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
686 unsigned char data; 687 unsigned char data;
687 688
688 snd_assert(channel >= 0 && channel <= 7, return 0); 689 if (snd_BUG_ON(channel < 0 || channel > 7))
690 return 0;
689 snd_i2c_lock(ice->i2c); 691 snd_i2c_lock(ice->i2c);
690 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) { 692 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
691 snd_i2c_unlock(ice->i2c); 693 snd_i2c_unlock(ice->i2c);
@@ -705,7 +707,8 @@ static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, st
705 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 707 int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
706 unsigned char data, ndata; 708 unsigned char data, ndata;
707 709
708 snd_assert(channel >= 0 && channel <= 7, return 0); 710 if (snd_BUG_ON(channel < 0 || channel > 7))
711 return 0;
709 snd_i2c_lock(ice->i2c); 712 snd_i2c_lock(ice->i2c);
710 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) { 713 if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
711 snd_i2c_unlock(ice->i2c); 714 snd_i2c_unlock(ice->i2c);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 29d449d73c98..05ffab65d167 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2416,7 +2416,8 @@ int __devinit snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice)
2416 int err; 2416 int err;
2417 struct snd_kcontrol *kctl; 2417 struct snd_kcontrol *kctl;
2418 2418
2419 snd_assert(ice->pcm_pro != NULL, return -EIO); 2419 if (snd_BUG_ON(!ice->pcm_pro))
2420 return -EIO;
2420 err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice)); 2421 err = snd_ctl_add(ice->card, kctl = snd_ctl_new1(&snd_ice1712_spdif_default, ice));
2421 if (err < 0) 2422 if (err < 0)
2422 return err; 2423 return err;
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index e596d777d9dd..60119d220a66 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2250,7 +2250,8 @@ static int __devinit snd_vt1724_spdif_build_controls(struct snd_ice1712 *ice)
2250 int err; 2250 int err;
2251 struct snd_kcontrol *kctl; 2251 struct snd_kcontrol *kctl;
2252 2252
2253 snd_assert(ice->pcm != NULL, return -EIO); 2253 if (snd_BUG_ON(!ice->pcm))
2254 return -EIO;
2254 2255
2255 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_vt1724_mixer_pro_spdif_route, ice)); 2256 err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_vt1724_mixer_pro_spdif_route, ice));
2256 if (err < 0) 2257 if (err < 0)
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c
index b4e0c16852a6..21ff4de890b4 100644
--- a/sound/pci/ice1712/juli.c
+++ b/sound/pci/ice1712/juli.c
@@ -208,7 +208,8 @@ static void juli_akm_write(struct snd_akm4xxx *ak, int chip,
208{ 208{
209 struct snd_ice1712 *ice = ak->private_data[0]; 209 struct snd_ice1712 *ice = ak->private_data[0];
210 210
211 snd_assert(chip == 0, return); 211 if (snd_BUG_ON(chip))
212 return;
212 snd_vt1724_write_i2c(ice, AK4358_ADDR, addr, data); 213 snd_vt1724_write_i2c(ice, AK4358_ADDR, addr, data);
213} 214}
214 215