X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=sound%2Fppc%2Fpmac.c;h=641430631505057f478f126fc7c91270e6fc921e;hb=0ebfff1491ef85d41ddf9c633834838be144f69f;hp=b678814975c9e1dd93297033966a527172ec8b28;hpb=6c763eb9ead86c612492b59287b36c0dcf7d09b1;p=linux-2.6 diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index b678814975..6414306315 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1120,6 +1120,7 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) struct snd_pmac *chip; struct device_node *np; int i, err; + unsigned int irq; unsigned long ctrl_addr, txdma_addr, rxdma_addr; static struct snd_device_ops ops = { .dev_free = snd_pmac_dev_free, @@ -1153,10 +1154,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) if (chip->is_k2) { static char *rnames[] = { "Sound Control", "Sound DMA" }; - if (np->n_intrs < 3) { - err = -ENODEV; - goto __error; - } for (i = 0; i < 2; i ++) { if (of_address_to_resource(np->parent, i, &chip->rsrc[i])) { @@ -1170,9 +1167,10 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) chip->rsrc[i].start + 1, rnames[i]) == NULL) { printk(KERN_ERR "snd: can't request rsrc " - " %d (%s: 0x%08lx:%08lx)\n", - i, rnames[i], chip->rsrc[i].start, - chip->rsrc[i].end); + " %d (%s: 0x%016llx:%016llx)\n", + i, rnames[i], + (unsigned long long)chip->rsrc[i].start, + (unsigned long long)chip->rsrc[i].end); err = -ENODEV; goto __error; } @@ -1184,10 +1182,6 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) } else { static char *rnames[] = { "Sound Control", "Sound Tx DMA", "Sound Rx DMA" }; - if (np->n_intrs < 3) { - err = -ENODEV; - goto __error; - } for (i = 0; i < 3; i ++) { if (of_address_to_resource(np, i, &chip->rsrc[i])) { @@ -1201,9 +1195,10 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) chip->rsrc[i].start + 1, rnames[i]) == NULL) { printk(KERN_ERR "snd: can't request rsrc " - " %d (%s: 0x%08lx:%08lx)\n", - i, rnames[i], chip->rsrc[i].start, - chip->rsrc[i].end); + " %d (%s: 0x%016llx:%016llx)\n", + i, rnames[i], + (unsigned long long)chip->rsrc[i].start, + (unsigned long long)chip->rsrc[i].end); err = -ENODEV; goto __error; } @@ -1218,28 +1213,30 @@ int __init snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) chip->playback.dma = ioremap(txdma_addr, 0x100); chip->capture.dma = ioremap(rxdma_addr, 0x100); if (chip->model <= PMAC_BURGUNDY) { - if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0, + irq = irq_of_parse_and_map(np, 0); + if (request_irq(irq, snd_pmac_ctrl_intr, 0, "PMac", (void*)chip)) { - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[0].line); + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", + irq); err = -EBUSY; goto __error; } - chip->irq = np->intrs[0].line; + chip->irq = irq; } - if (request_irq(np->intrs[1].line, snd_pmac_tx_intr, 0, - "PMac Output", (void*)chip)) { - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[1].line); + irq = irq_of_parse_and_map(np, 1); + if (request_irq(irq, snd_pmac_tx_intr, 0, "PMac Output", (void*)chip)){ + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq); err = -EBUSY; goto __error; } - chip->tx_irq = np->intrs[1].line; - if (request_irq(np->intrs[2].line, snd_pmac_rx_intr, 0, - "PMac Input", (void*)chip)) { - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[2].line); + chip->tx_irq = irq; + irq = irq_of_parse_and_map(np, 2); + if (request_irq(irq, snd_pmac_rx_intr, 0, "PMac Input", (void*)chip)) { + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq); err = -EBUSY; goto __error; } - chip->rx_irq = np->intrs[2].line; + chip->rx_irq = irq; snd_pmac_sound_feature(chip, 1);