]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/es1968.c
arm ide breakage
[linux-2.6-omap-h63xx.git] / sound / pci / es1968.c
index f8f3bb662d1726ac0b7c516d630bc55a3f1536f2..20ee7599600bee87340f264e99842a4efa195465 100644 (file)
@@ -692,7 +692,8 @@ static void apu_data_set(struct es1968 *chip, u16 data)
 /* no spinlock */
 static void __apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data)
 {
-       snd_assert(channel < NR_APUS, return);
+       if (snd_BUG_ON(channel >= NR_APUS))
+               return;
 #ifdef CONFIG_PM
        chip->apu_map[channel][reg] = data;
 #endif
@@ -711,7 +712,8 @@ static void apu_set_register(struct es1968 *chip, u16 channel, u8 reg, u16 data)
 
 static u16 __apu_get_register(struct es1968 *chip, u16 channel, u8 reg)
 {
-       snd_assert(channel < NR_APUS, return 0);
+       if (snd_BUG_ON(channel >= NR_APUS))
+               return 0;
        reg |= (channel << 4);
        apu_index_set(chip, reg);
        return __maestro_read(chip, IDR0_DATA_PORT);
@@ -1840,9 +1842,8 @@ static void snd_es1968_suppress_jitter(struct es1968 *chip, struct esschan *es)
        cp2 = __apu_get_register(chip, 1, 5);
        diff = (cp1 > cp2 ? cp1 - cp2 : cp2 - cp1);
 
-       if (diff > 1) {
+       if (diff > 1)
                __maestro_write(chip, IDR0_DATA_PORT, cp1);
-       }
 }
 
 /*
@@ -2476,7 +2477,8 @@ static inline void snd_es1968_free_gameport(struct es1968 *chip) { }
 static int snd_es1968_free(struct es1968 *chip)
 {
        if (chip->io_port) {
-               synchronize_irq(chip->irq);
+               if (chip->irq >= 0)
+                       synchronize_irq(chip->irq);
                outw(1, chip->io_port + 0x04); /* clear WP interrupts */
                outw(0, chip->io_port + ESM_PORT_HOST_IRQ); /* disable IRQ */
        }