]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/cell/axon_msi.c
[POWERPC] Make sure to of_node_get() the result of pci_device_to_OF_node()
[linux-2.6] / arch / powerpc / platforms / cell / axon_msi.c
index 4c9ab5b70bae0e8c590021fa55d88710bc6bfa61..4bde8da11f446e8523f0dcad29227957f829a253 100644 (file)
@@ -64,7 +64,6 @@
 
 
 struct axon_msic {
-       struct device_node *dn;
        struct irq_host *irq_host;
        __le32 *fifo;
        dcr_host_t dcr_host;
@@ -126,7 +125,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
        const phandle *ph;
        struct axon_msic *msic = NULL;
 
-       dn = pci_device_to_OF_node(dev);
+       dn = of_node_get(pci_device_to_OF_node(dev));
        if (!dn) {
                dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
                return NULL;
@@ -183,7 +182,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
        int len;
        const u32 *prop;
 
-       dn = pci_device_to_OF_node(dev);
+       dn = of_node_get(pci_device_to_OF_node(dev));
        if (!dn) {
                dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
                return -ENODEV;
@@ -295,15 +294,7 @@ static int msic_host_map(struct irq_host *h, unsigned int virq,
        return 0;
 }
 
-static int msic_host_match(struct irq_host *host, struct device_node *dn)
-{
-       struct axon_msic *msic = host->host_data;
-
-       return msic->dn == dn;
-}
-
 static struct irq_host_ops msic_host_ops = {
-       .match  = msic_host_match,
        .map    = msic_host_map,
 };
 
@@ -314,7 +305,8 @@ static int axon_msi_notify_reboot(struct notifier_block *nb,
        u32 tmp;
 
        list_for_each_entry(msic, &axon_msic_list, list) {
-               pr_debug("axon_msi: disabling %s\n", msic->dn->full_name);
+               pr_debug("axon_msi: disabling %s\n",
+                         msic->irq_host->of_node->full_name);
                tmp  = msic_dcr_read(msic, MSIC_CTRL_REG);
                tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
                msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
@@ -370,8 +362,8 @@ static int axon_msi_setup_one(struct device_node *dn)
 
        msic->fifo = page_address(page);
 
-       msic->irq_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, NR_IRQS,
-                                       &msic_host_ops, 0);
+       msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP,
+                                       NR_IRQS, &msic_host_ops, 0);
        if (!msic->irq_host) {
                printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n",
                       dn->full_name);
@@ -387,8 +379,6 @@ static int axon_msi_setup_one(struct device_node *dn)
                goto out_free_host;
        }
 
-       msic->dn = of_node_get(dn);
-
        set_irq_data(virq, msic);
        set_irq_chained_handler(virq, axon_msi_cascade);
        pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq);