]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spider-pic.c
Merge branch 'linus' into x86/cleanups
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spider-pic.c
index fb1f15797bbbb837b29b337d90217c4339e7e38c..4e5655624ae877f1e0c8de8eaac716fba9db4f21 100644 (file)
@@ -63,7 +63,6 @@ enum {
 
 struct spider_pic {
        struct irq_host         *host;
-       struct device_node      *of_node;
        void __iomem            *regs;
        unsigned int            node_id;
 };
@@ -176,12 +175,6 @@ static struct irq_chip spider_pic = {
        .set_type = spider_set_irq_type,
 };
 
-static int spider_host_match(struct irq_host *h, struct device_node *node)
-{
-       struct spider_pic *pic = h->host_data;
-       return node == pic->of_node;
-}
-
 static int spider_host_map(struct irq_host *h, unsigned int virq,
                        irq_hw_number_t hw)
 {
@@ -208,7 +201,6 @@ static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
 }
 
 static struct irq_host_ops spider_host_ops = {
-       .match = spider_host_match,
        .map = spider_host_map,
        .xlate = spider_host_xlate,
 };
@@ -247,18 +239,18 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
         * tree in case the device-tree is ever fixed
         */
        struct of_irq oirq;
-       if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) {
+       if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
                virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
                                             oirq.size);
                return virq;
        }
 
        /* Now do the horrible hacks */
-       tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL);
+       tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
        if (tmp == NULL)
                return NO_IRQ;
        intsize = *tmp;
-       imap = of_get_property(pic->of_node, "interrupt-map", &imaplen);
+       imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen);
        if (imap == NULL || imaplen < (intsize + 1))
                return NO_IRQ;
        iic = of_find_node_by_phandle(imap[intsize]);
@@ -308,15 +300,13 @@ static void __init spider_init_one(struct device_node *of_node, int chip,
                panic("spider_pic: can't map registers !");
 
        /* Allocate a host */
-       pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT,
-                                  &spider_host_ops, SPIDER_IRQ_INVALID);
+       pic->host = irq_alloc_host(of_node, IRQ_HOST_MAP_LINEAR,
+                                  SPIDER_SRC_COUNT, &spider_host_ops,
+                                  SPIDER_IRQ_INVALID);
        if (pic->host == NULL)
                panic("spider_pic: can't allocate irq host !");
        pic->host->host_data = pic;
 
-       /* Fill out other bits */
-       pic->of_node = of_node_get(of_node);
-
        /* Go through all sources and disable them */
        for (i = 0; i < SPIDER_SRC_COUNT; i++) {
                void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
@@ -358,12 +348,12 @@ void __init spider_init_IRQ(void)
         */
        for (dn = NULL;
             (dn = of_find_node_by_name(dn, "interrupt-controller"));) {
-               if (device_is_compatible(dn, "CBEA,platform-spider-pic")) {
+               if (of_device_is_compatible(dn, "CBEA,platform-spider-pic")) {
                        if (of_address_to_resource(dn, 0, &r)) {
                                printk(KERN_WARNING "spider-pic: Failed\n");
                                continue;
                        }
-               } else if (device_is_compatible(dn, "sti,platform-spider-pic")
+               } else if (of_device_is_compatible(dn, "sti,platform-spider-pic")
                           && (chip < 2)) {
                        static long hard_coded_pics[] =
                                { 0x24000008000ul, 0x34000008000ul};