powerpc: Fixup last users of irq_chip->typename
[safe/jmp/linux-2.6] / arch / powerpc / sysdev / mpc8xx_pic.c
index 565156a..db0a712 100644 (file)
@@ -10,7 +10,6 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/8xx_immap.h>
-#include <asm/mpc8xx.h>
 
 #include "mpc8xx_pic.h"
 
@@ -22,7 +21,7 @@ extern int cpm_get_irq(struct pt_regs *regs);
 static struct irq_host *mpc8xx_pic_host;
 #define NR_MASK_WORDS   ((NR_IRQS + 31) / 32)
 static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
-static sysconf8xx_t    *siu_reg;
+static sysconf8xx_t __iomem *siu_reg;
 
 int cpm_get_irq(struct pt_regs *regs);
 
@@ -73,7 +72,7 @@ static void mpc8xx_end_irq(unsigned int virq)
 
 static int mpc8xx_set_irq_type(unsigned int virq, unsigned int flow_type)
 {
-       struct irq_desc *desc = get_irq_desc(virq);
+       struct irq_desc *desc = irq_to_desc(virq);
 
        desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
        desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
@@ -95,7 +94,7 @@ static int mpc8xx_set_irq_type(unsigned int virq, unsigned int flow_type)
 }
 
 static struct irq_chip mpc8xx_pic = {
-       .typename = " MPC8XX SIU ",
+       .name = " MPC8XX SIU ",
        .unmask = mpc8xx_unmask_irq,
        .mask = mpc8xx_mask_irq,
        .ack = mpc8xx_ack,
@@ -159,13 +158,14 @@ static struct irq_host_ops mpc8xx_pic_host_ops = {
 int mpc8xx_pic_init(void)
 {
        struct resource res;
-       struct device_node *np = NULL;
+       struct device_node *np;
        int ret;
 
-       np = of_find_node_by_type(np, "mpc8xx-pic");
-
+       np = of_find_compatible_node(NULL, NULL, "fsl,pq1-pic");
+       if (np == NULL)
+               np = of_find_node_by_type(NULL, "mpc8xx-pic");
        if (np == NULL) {
-               printk(KERN_ERR "Could not find open-pic node\n");
+               printk(KERN_ERR "Could not find fsl,pq1-pic node\n");
                return -ENOMEM;
        }
 
@@ -173,18 +173,20 @@ int mpc8xx_pic_init(void)
        if (ret)
                goto out;
 
-       siu_reg = (void *)ioremap(res.start, res.end - res.start + 1);
+       siu_reg = ioremap(res.start, res.end - res.start + 1);
        if (siu_reg == NULL) {
                ret = -EINVAL;
                goto out;
        }
 
-       mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
+       mpc8xx_pic_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR,
                                         64, &mpc8xx_pic_host_ops, 64);
        if (mpc8xx_pic_host == NULL) {
                printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
                ret = -ENOMEM;
+               goto out;
        }
+       return 0;
 
 out:
        of_node_put(np);