Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / arch / powerpc / sysdev / ipic.c
index 746f78c..e898ff4 100644 (file)
@@ -511,10 +511,8 @@ static struct irq_chip ipic_irq_chip = {
 
 static int ipic_host_match(struct irq_host *h, struct device_node *node)
 {
-       struct ipic *ipic = h->host_data;
-
        /* Exact match, unless ipic node is NULL */
-       return ipic->of_node == NULL || ipic->of_node == node;
+       return h->of_node == NULL || h->of_node == node;
 }
 
 static int ipic_host_map(struct irq_host *h, unsigned int virq,
@@ -557,8 +555,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 +563,23 @@ 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->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR,
+       ipic->irqhost = irq_alloc_host(of_node_get(node), 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 +623,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)
@@ -725,7 +725,7 @@ unsigned int ipic_get_irq(void)
 }
 
 static struct sysdev_class ipic_sysclass = {
-       set_kset_name("ipic"),
+       .name = "ipic",
 };
 
 static struct sys_device device_ipic = {