nfsd4: don't continue "under" mounts in V4ROOT case
[safe/jmp/linux-2.6] / sound / oss / mpu401.c
index 162d07c..734b8f9 100644 (file)
@@ -432,10 +432,10 @@ static void mpu401_input_loop(struct mpu_config *devc)
        devc->m_busy = 0;
 }
 
-static irqreturn_t mpuintr(int irq, void *dev_id, struct pt_regs *dummy)
+static irqreturn_t mpuintr(int irq, void *dev_id)
 {
        struct mpu_config *devc;
-       int dev = (int) dev_id;
+       int dev = (int)(unsigned long) dev_id;
        int handled = 0;
 
        devc = &dev_conf[dev];
@@ -926,31 +926,21 @@ static struct midi_operations mpu401_midi_operations[MAX_MIDI_DEV];
 static void mpu401_chk_version(int n, struct mpu_config *devc)
 {
        int tmp;
-       unsigned long flags;
 
        devc->version = devc->revision = 0;
 
-       spin_lock_irqsave(&devc->lock,flags);
-       if ((tmp = mpu_cmd(n, 0xAC, 0)) < 0)
-       {
-               spin_unlock_irqrestore(&devc->lock,flags);
+       tmp = mpu_cmd(n, 0xAC, 0);
+       if (tmp < 0)
                return;
-       }
        if ((tmp & 0xf0) > 0x20)        /* Why it's larger than 2.x ??? */
-       {
-               spin_unlock_irqrestore(&devc->lock,flags);
                return;
-       }
        devc->version = tmp;
 
-       if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0)
-       {
+       if ((tmp = mpu_cmd(n, 0xAD, 0)) < 0) {
                devc->version = 0;
-               spin_unlock_irqrestore(&devc->lock,flags);
                return;
        }
        devc->revision = tmp;
-       spin_unlock_irqrestore(&devc->lock,flags);
 }
 
 int attach_mpu401(struct address_info *hw_config, struct module *owner)
@@ -1003,7 +993,8 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
                }
                if (!devc->shared_irq)
                {
-                       if (request_irq(devc->irq, mpuintr, 0, "mpu401", (void *)m) < 0)
+                       if (request_irq(devc->irq, mpuintr, 0, "mpu401",
+                                       hw_config) < 0)
                        {
                                printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq);
                                ret = -ENOMEM;
@@ -1014,7 +1005,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
                mpu401_chk_version(m, devc);
                if (devc->version == 0)
                        mpu401_chk_version(m, devc);
-                       spin_unlock_irqrestore(&devc->lock,flags);
+               spin_unlock_irqrestore(&devc->lock, flags);
        }
 
        if (devc->version != 0)
@@ -1023,7 +1014,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
                                devc->capabilities |= MPU_CAP_INTLG;    /* Supports intelligent mode */
 
 
-       mpu401_synth_operations[m] = (struct synth_operations *)kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
+       mpu401_synth_operations[m] = kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
 
        if (mpu401_synth_operations[m] == NULL)
        {
@@ -1083,7 +1074,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
                        sprintf(mpu_synth_info[m].name, "%s (MPU401)", hw_config->name);
                else
                        sprintf(mpu_synth_info[m].name,
-                               "MPU-401 %d.%d%c Midi interface #%d",
+                               "MPU-401 %d.%d%c MIDI #%d",
                                (int) (devc->version & 0xf0) >> 4,
                                devc->version & 0x0f,
                                revision_char,
@@ -1112,7 +1103,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
        return 0;
 
 out_irq:
-       free_irq(devc->irq, (void *)m);
+       free_irq(devc->irq, hw_config);
 out_mididev:
        sound_unload_mididev(m);
 out_err:
@@ -1227,7 +1218,7 @@ void unload_mpu401(struct address_info *hw_config)
        if (n != -1) {
                release_region(hw_config->io_base, 2);
                if (hw_config->always_detect == 0 && hw_config->irq > 0)
-                       free_irq(hw_config->irq, (void *)n);
+                       free_irq(hw_config->irq, hw_config);
                p=mpu401_synth_operations[n];
                sound_unload_mididev(n);
                sound_unload_timerdev(hw_config->slots[2]);