]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/mips/au1x00.c
Pull release into acpica branch
[mv-sheeva.git] / sound / mips / au1x00.c
index c20522b0213463409a92f750c50940944081e19a..d08a42b24b1f847a43b54203da326aaa45d7c35e 100644 (file)
@@ -57,8 +57,6 @@ MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{AMD,Au1000 AC'97}}");
 #endif
 
-#define chip_t au1000_t
-
 #define PLAYBACK 0
 #define CAPTURE 1
 #define AC97_SLOT_3 0x01
@@ -474,7 +472,7 @@ snd_au1000_ac97_read(ac97_t *ac97, unsigned short reg)
        u32 volatile cmd;
        u16 volatile data;
        int             i;
-       spin_lock(au1000->ac97_lock);
+       spin_lock(&au1000->ac97_lock);
 /* would rather use the interupt than this polling but it works and I can't
 get the interupt driven case to work efficiently */
        for (i = 0; i < 0x5000; i++)
@@ -497,7 +495,7 @@ get the interupt driven case to work efficiently */
        }
 
        data = au1000->ac97_ioport->cmd & 0xffff;
-       spin_unlock(au1000->ac97_lock);
+       spin_unlock(&au1000->ac97_lock);
 
        return data;
 
@@ -509,7 +507,7 @@ snd_au1000_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val)
 {
        u32 cmd;
        int i;
-       spin_lock(au1000->ac97_lock);
+       spin_lock(&au1000->ac97_lock);
 /* would rather use the interupt than this polling but it works and I can't
 get the interupt driven case to work efficiently */
        for (i = 0; i < 0x5000; i++)
@@ -522,7 +520,7 @@ get the interupt driven case to work efficiently */
        cmd &= ~AC97C_READ;
        cmd |= ((u32) val << AC97C_WD_BIT);
        au1000->ac97_ioport->cmd = cmd;
-       spin_unlock(au1000->ac97_lock);
+       spin_unlock(&au1000->ac97_lock);
 }
 static void
 snd_au1000_ac97_free(ac97_t *ac97)
@@ -606,8 +604,7 @@ snd_au1000_free(snd_card_t *card)
                /* put internal AC97 block into reset */
                au1000->ac97_ioport->cntrl = AC97C_RS;
                au1000->ac97_ioport = NULL;
-               release_resource(au1000->ac97_res_port);
-               kfree_nocheck(au1000->ac97_res_port);
+               release_and_free_resource(au1000->ac97_res_port);
        }
 
        if (au1000->stream[PLAYBACK]->dma >= 0)
@@ -667,6 +664,11 @@ au1000_init(void)
        strcpy(au1000->card->shortname, "Au1000-AC97");
        sprintf(au1000->card->longname, "AMD Au1000--AC97 ALSA Driver");
 
+       if ((err = snd_card_set_generic_dev(au1000->card)) < 0) {
+               snd_card_free(au1000->card);
+               return err;
+       }
+
        if ((err = snd_card_register(au1000->card)) < 0) {
                snd_card_free(au1000->card);
                return err;