Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: fsl_msi doesn't need it's own of_node

The FSL MSI code keeps a pointer to the of_node from the device
it represents. However it also has an irq_host, which contains
a pointer to the of_node, so use that one instead.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Michael Ellerman and committed by
Paul Mackerras
611cd90c dcfcfe75

+5 -10
+5 -7
arch/powerpc/sysdev/fsl_msi.c
··· 108 108 bitmap_allocate_region(msi->fsl_msi_bitmap, 0, 109 109 get_count_order(NR_MSI_IRQS)); 110 110 111 - p = of_get_property(msi->of_node, "msi-available-ranges", &len); 111 + p = of_get_property(msi->irqhost->of_node, "msi-available-ranges", 112 + &len); 112 113 113 114 if (!p) { 114 115 /* No msi-available-ranges property, ··· 121 120 122 121 if ((len % (2 * sizeof(u32))) != 0) { 123 122 printk(KERN_WARNING "fsl_msi: Malformed msi-available-ranges " 124 - "property on %s\n", msi->of_node->full_name); 123 + "property on %s\n", msi->irqhost->of_node->full_name); 125 124 return -EINVAL; 126 125 } 127 126 ··· 318 317 goto error_out; 319 318 } 320 319 321 - msi->of_node = of_node_get(dev->node); 320 + msi->irqhost = irq_alloc_host(dev->node, IRQ_HOST_MAP_LINEAR, 321 + NR_MSI_IRQS, &fsl_msi_host_ops, 0); 322 322 323 - msi->irqhost = irq_alloc_host(of_node_get(dev->node), 324 - IRQ_HOST_MAP_LINEAR, 325 - NR_MSI_IRQS, &fsl_msi_host_ops, 0); 326 323 if (msi->irqhost == NULL) { 327 324 dev_err(&dev->dev, "No memory for MSI irqhost\n"); 328 - of_node_put(dev->node); 329 325 err = -ENOMEM; 330 326 goto error_out; 331 327 }
-3
arch/powerpc/sysdev/fsl_msi.h
··· 22 22 #define FSL_PIC_IP_IPIC 0x00000002 23 23 24 24 struct fsl_msi { 25 - /* Device node of the MSI interrupt*/ 26 - struct device_node *of_node; 27 - 28 25 struct irq_host *irqhost; 29 26 30 27 unsigned long cascade_irq;