]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/mpc8xx_pic.c
OMAP1: clock: Typo fix for clock in omap1
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / mpc8xx_pic.c
index 2fc2bcd79b5efeca1ed8c4482e6751da80c3f117..5d2d5522ef416846a0ba9bf8073c05652227d4c7 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"
 
 
 extern int cpm_get_irq(struct pt_regs *regs);
 
-static struct device_node *mpc8xx_pic_node;
 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);
 
@@ -120,11 +118,6 @@ unsigned int mpc8xx_get_irq(void)
 
 }
 
-static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node)
-{
-       return mpc8xx_pic_node == node;
-}
-
 static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq,
                          irq_hw_number_t hw)
 {
@@ -158,7 +151,6 @@ static int mpc8xx_pic_host_xlate(struct irq_host *h, struct device_node *ct,
 
 
 static struct irq_host_ops mpc8xx_pic_host_ops = {
-       .match = mpc8xx_pic_host_match,
        .map = mpc8xx_pic_host_map,
        .xlate = mpc8xx_pic_host_xlate,
 };
@@ -166,32 +158,37 @@ 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;
        }
 
-       mpc8xx_pic_node = of_node_get(np);
-
        ret = of_address_to_resource(np, 0, &res);
-       of_node_put(np);
        if (ret)
-               return ret;
+               goto out;
 
-       siu_reg = (void *)ioremap(res.start, res.end - res.start + 1);
-       if (siu_reg == NULL)
-               return -EINVAL;
+       siu_reg = ioremap(res.start, res.end - res.start + 1);
+       if (siu_reg == NULL) {
+               ret = -EINVAL;
+               goto out;
+       }
 
-       mpc8xx_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &mpc8xx_pic_host_ops, 64);
+       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);
        return ret;
 }