aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/vx222/vx222_ops.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 20:31:54 -0400
commit6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch)
tree06a5a9a08519950575505273eabced331ed51405 /sound/pci/vx222/vx222_ops.c
parentee673eaa72d8d185012b1027a05e25aba18c267f (diff)
parent8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff)
Merge commit 'origin'
Manual fixup of conflicts on: arch/powerpc/include/asm/dcr-regs.h drivers/net/ibm_newemac/core.h
Diffstat (limited to 'sound/pci/vx222/vx222_ops.c')
-rw-r--r--sound/pci/vx222/vx222_ops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 631f3a639993..7e87f398ff0b 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -253,7 +253,8 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
253 int offset = pipe->hw_ptr; 253 int offset = pipe->hw_ptr;
254 u32 *addr = (u32 *)(runtime->dma_area + offset); 254 u32 *addr = (u32 *)(runtime->dma_area + offset);
255 255
256 snd_assert(count % 4 == 0, return); 256 if (snd_BUG_ON(count % 4))
257 return;
257 258
258 vx2_setup_pseudo_dma(chip, 1); 259 vx2_setup_pseudo_dma(chip, 1);
259 260
@@ -291,7 +292,8 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
291 u32 *addr = (u32 *)(runtime->dma_area + offset); 292 u32 *addr = (u32 *)(runtime->dma_area + offset);
292 unsigned long port = vx2_reg_addr(chip, VX_DMA); 293 unsigned long port = vx2_reg_addr(chip, VX_DMA);
293 294
294 snd_assert(count % 4 == 0, return); 295 if (snd_BUG_ON(count % 4))
296 return;
295 297
296 vx2_setup_pseudo_dma(chip, 0); 298 vx2_setup_pseudo_dma(chip, 0);
297 /* Transfer using pseudo-dma. 299 /* Transfer using pseudo-dma.
@@ -675,7 +677,8 @@ static void vx2_write_akm(struct vx_core *chip, int reg, unsigned int data)
675 a look up table, as there is no linear matching between the driver codec values 677 a look up table, as there is no linear matching between the driver codec values
676 and the real dBu value 678 and the real dBu value
677 */ 679 */
678 snd_assert(data < sizeof(vx2_akm_gains_lut), return); 680 if (snd_BUG_ON(data >= sizeof(vx2_akm_gains_lut)))
681 return;
679 682
680 switch (reg) { 683 switch (reg) {
681 case XX_CODEC_LEVEL_LEFT_REGISTER: 684 case XX_CODEC_LEVEL_LEFT_REGISTER:
@@ -823,7 +826,8 @@ static void vx2_set_input_level(struct snd_vx222 *chip)
823 preamp++; /* raise pre ampli + 18dB */ 826 preamp++; /* raise pre ampli + 18dB */
824 miclevel -= (18 * 2); /* lower level 18 dB (*2 because of 0.5 dB steps !) */ 827 miclevel -= (18 * 2); /* lower level 18 dB (*2 because of 0.5 dB steps !) */
825 } 828 }
826 snd_assert(preamp < 4, return); 829 if (snd_BUG_ON(preamp >= 4))
830 return;
827 831
828 /* set pre-amp level */ 832 /* set pre-amp level */
829 chip->regSELMIC &= ~MICRO_SELECT_PREAMPLI_MASK; 833 chip->regSELMIC &= ~MICRO_SELECT_PREAMPLI_MASK;