Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / arch / powerpc / sysdev / ipic.c
index 0251b7c..473c415 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/asm-ppc/ipic.c
+ * arch/powerpc/sysdev/ipic.c
  *
  * IPIC routines implementations.
  *
@@ -473,9 +473,9 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
        desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
        if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
                desc->status |= IRQ_LEVEL;
-               set_irq_handler(virq, handle_level_irq);
+               desc->handle_irq = handle_level_irq;
        } else {
-               set_irq_handler(virq, handle_edge_irq);
+               desc->handle_irq = handle_edge_irq;
        }
 
        /* only EXT IRQ senses are programmable on ipic
@@ -557,8 +557,7 @@ static struct irq_host_ops ipic_host_ops = {
        .xlate  = ipic_host_xlate,
 };
 
-void __init ipic_init(struct device_node *node,
-               unsigned int flags)
+struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
 {
        struct ipic     *ipic;
        struct resource res;
@@ -566,22 +565,24 @@ void __init ipic_init(struct device_node *node,
 
        ipic = alloc_bootmem(sizeof(struct ipic));
        if (ipic == NULL)
-               return;
+               return NULL;
 
        memset(ipic, 0, sizeof(struct ipic));
-       ipic->of_node = node ? of_node_get(node) : NULL;
+       ipic->of_node = of_node_get(node);
 
        ipic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR,
                                       NR_IPIC_INTS,
                                       &ipic_host_ops, 0);
        if (ipic->irqhost == NULL) {
                of_node_put(node);
-               return;
+               return NULL;
        }
 
        ret = of_address_to_resource(node, 0, &res);
-       if (ret)
-               return;
+       if (ret) {
+               of_node_put(node);
+               return NULL;
+       }
 
        ipic->regs = ioremap(res.start, res.end - res.start + 1);
 
@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node,
 
        printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
                        primary_ipic->regs);
+
+       return ipic;
 }
 
 int ipic_set_priority(unsigned int virq, unsigned int priority)
@@ -709,7 +712,7 @@ void ipic_clear_mcp_status(u32 mask)
 }
 
 /* Return an interrupt vector or NO_IRQ if no interrupt is pending. */
-unsigned int ipic_get_irq(struct pt_regs *regs)
+unsigned int ipic_get_irq(void)
 {
        int irq;