]> err.no Git - linux-2.6/blobdiff - sound/pci/ali5451/ali5451.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6] / sound / pci / ali5451 / ali5451.c
index e1ed59549c5063a76ba0eb200f966ebaa0c268c8..05b4c869694188f5955a29449b19c469662fbc75 100644 (file)
@@ -239,7 +239,7 @@ struct snd_ali_image {
 
 
 struct snd_ali {
-       unsigned long   irq;
+       int             irq;
        unsigned long   port;
        unsigned char   revision;
 
@@ -731,8 +731,7 @@ static void snd_ali_detect_spdif_rate(struct snd_ali *codec)
                return;
        }
 
-       count = 0;
-       while (count++ <= 50000) {
+       for (count = 0; count <= 50000; count++) {
                snd_ali_delay(codec, 6);
                bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1));
                R2 = bval & 0x1F;
@@ -1250,7 +1249,7 @@ static int snd_ali_playback_hw_params(struct snd_pcm_substream *substream,
                        evoice->substream = substream;
                }
        } else {
-               if (!evoice) {
+               if (evoice) {
                        snd_ali_free_voice(codec, evoice);
                        pvoice->extra = evoice = NULL;
                }
@@ -1267,7 +1266,7 @@ static int snd_ali_playback_hw_free(struct snd_pcm_substream *substream)
        struct snd_ali_voice *evoice = pvoice ? pvoice->extra : NULL;
 
        snd_pcm_lib_free_pages(substream);
-       if (!evoice) {
+       if (evoice) {
                snd_ali_free_voice(codec, evoice);
                pvoice->extra = NULL;
        }
@@ -1356,7 +1355,7 @@ static int snd_ali_playback_prepare(struct snd_pcm_substream *substream)
                                 VOL,
                                 CTRL,
                                 EC);
-       if (!evoice) {
+       if (evoice) {
                evoice->count = pvoice->count;
                evoice->eso = pvoice->count << 1;
                ESO = evoice->eso - 1;
@@ -2218,7 +2217,7 @@ static int __devinit snd_ali_create(struct snd_card *card,
        codec->card = card;
        codec->pci = pci;
        codec->irq = -1;
-       pci_read_config_byte(pci, PCI_REVISION_ID, &codec->revision);
+       codec->revision = pci->revision;
        codec->spdif_support = spdif_support;
 
        if (pcm_streams < 1)
@@ -2343,7 +2342,7 @@ static int __devinit snd_ali_probe(struct pci_dev *pci,
        strcpy(card->driver, "ALI5451");
        strcpy(card->shortname, "ALI 5451");
        
-       sprintf(card->longname, "%s at 0x%lx, irq %li",
+       sprintf(card->longname, "%s at 0x%lx, irq %i",
                card->shortname, codec->port, codec->irq);
 
        snd_ali_printk("register card.\n");