From: Benjamin Herrenschmidt Date: Mon, 31 May 2010 00:01:50 +0000 (+1000) Subject: Merge commit 'kumar/next' into next X-Git-Tag: v2.6.35-rc2~55^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ecca1a34befbb13fc23d9a2cc0d6b725c7727fb2;p=platform%2Fkernel%2Flinux-exynos.git Merge commit 'kumar/next' into next Conflicts: arch/powerpc/sysdev/fsl_msi.c --- ecca1a34befbb13fc23d9a2cc0d6b725c7727fb2 diff --cc arch/powerpc/sysdev/fsl_msi.c index a7be144,f7ca9e6..0f5bee9 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@@ -245,11 -293,11 +293,11 @@@ static int __devinit fsl_of_msi_probe(s msi = kzalloc(sizeof(struct fsl_msi), GFP_KERNEL); if (!msi) { dev_err(&dev->dev, "No memory for MSI structure\n"); - err = -ENOMEM; - goto error_out; + return -ENOMEM; } + dev->dev.platform_data = msi; - msi->irqhost = irq_alloc_host(dev->node, IRQ_HOST_MAP_LINEAR, + msi->irqhost = irq_alloc_host(dev->dev.of_node, IRQ_HOST_MAP_LINEAR, NR_MSI_IRQS, &fsl_msi_host_ops, 0); if (msi->irqhost == NULL) { @@@ -298,14 -346,28 +346,28 @@@ err = -EINVAL; goto error_out; } + offset = 0; + p = of_get_property(dev->node, "msi-available-ranges", &len); + if (p) + offset = *p / IRQS_PER_MSI_REG; count /= sizeof(u32); - for (i = 0; i < count / 2; i++) { - if (i > NR_MSI_REG) - break; + for (i = 0; i < min(count / 2, NR_MSI_REG); i++) { - virt_msir = irq_of_parse_and_map(dev->node, i); + virt_msir = irq_of_parse_and_map(dev->dev.of_node, i); if (virt_msir != NO_IRQ) { - set_irq_data(virt_msir, (void *)i); + cascade_data = kzalloc( + sizeof(struct fsl_msi_cascade_data), + GFP_KERNEL); + if (!cascade_data) { + dev_err(&dev->dev, + "No memory for MSI cascade data\n"); + err = -ENOMEM; + goto error_out; + } + msi->msi_virqs[i] = virt_msir; + cascade_data->index = i + offset; + cascade_data->msi_data = msi; + set_irq_data(virt_msir, (void *)cascade_data); set_irq_chained_handler(virt_msir, fsl_msi_cascade); } } @@@ -345,12 -413,10 +413,13 @@@ static const struct of_device_id fsl_of }; static struct of_platform_driver fsl_of_msi_driver = { - .name = "fsl-msi", - .match_table = fsl_of_msi_ids, + .driver = { + .name = "fsl-msi", + .owner = THIS_MODULE, + .of_match_table = fsl_of_msi_ids, + }, .probe = fsl_of_msi_probe, + .remove = fsl_of_msi_remove, }; static __init int fsl_of_msi_init(void)