988
989 if (devc->irq < 0)
990 {
991 devc->irq *= -1;
992 devc->shared_irq = 1;
993 }
994
995 if (!hw_config->always_detect)
996 {
997
998 if (!reset_mpu401(devc))
999 {
1000 printk(KERN_WARNING "mpu401: Device didn't respond\n");
1001 ret = -ENODEV;
1002 goto out_mididev;
1003 }
1004 if (!devc->shared_irq)
1005 {
1006 if (request_irq(devc->irq, mpuintr, 0, "mpu401",
1007 hw_config) < 0)
1008 {
1009 printk(KERN_WARNING "mpu401: Failed to allocate IRQ%d\n", devc->irq);
1010 ret = -ENOMEM;
1011 goto out_mididev;
1012 }
1013 }
1014 spin_lock_irqsave(&devc->lock,flags);
1015 mpu401_chk_version(m, devc);
1016 if (devc->version == 0)
1017 mpu401_chk_version(m, devc);
1018 spin_unlock_irqrestore(&devc->lock, flags);
1019 }
1020
1021 if (devc->version != 0)
1022 if (mpu_cmd(m, 0xC5, 0) >= 0)
1023 if (mpu_cmd(m, 0xE0, 120) >= 0)
1024 devc->capabilities |= MPU_CAP_INTLG;
1025
1026
1027 mpu401_synth_operations[m] = kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
1028