[ALSA] ad1816a: Fix modprobe snd_mpu401 && modprobe snd_ad1816a
authorRask Ingemann Lambertsen <rask@sygehus.dk>
Mon, 19 Mar 2007 10:38:11 +0000 (11:38 +0100)
committerJaroslav Kysela <perex@suse.cz>
Fri, 11 May 2007 14:55:49 +0000 (16:55 +0200)
   The ad1816a driver fails if the mpu401 driver has been loaded first. This
patch against linux 2.6.20 fixes it by just ignoring the MPU-401 device in
that case, so that the rest of the sound card can be used. The ad1816a
driver already handles the MPU-401 device being unavailable due to lack of
resources in the same way.

Signed-off-by: Rask Ingemann Lambertsen <rask@sygehus.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/isa/ad1816a/ad1816a.c

index 59034507175b617b331c1dad07028344813e8f57..fc88a31da6f51a6730d75e6c2cd2e058ac5d1781 100644 (file)
@@ -129,8 +129,8 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
        }
        acard->devmpu = pnp_request_card_device(card, id->devs[1].id, NULL);
        if (acard->devmpu == NULL) {
-               kfree(cfg);
-               return -EBUSY;
+               mpu_port[dev] = -1;
+               snd_printk(KERN_WARNING PFX "MPU401 device busy, skipping.\n");
        }
 
        pdev = acard->dev;
@@ -162,6 +162,10 @@ static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acar
        dma2[dev] = pnp_dma(pdev, 1);
        irq[dev] = pnp_irq(pdev, 0);
 
+       if (acard->devmpu == NULL) {
+               kfree(cfg);
+               return 0;
+       }
        pdev = acard->devmpu;
        pnp_init_resource_table(cfg);