diff options
Diffstat (limited to 'sound/pci/ice1712/ews.c')
-rw-r--r-- | sound/pci/ice1712/ews.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); |