Messages in this thread Patch in this message | | | Date | Fri, 8 Aug 2008 17:41:44 +0200 | From | Marc Zyngier <> | Subject | [PATCH] Let isp116x-hcd get IRQ flags from resource |
| |
Olav,
This patch let the isp116x-hcd driver obtain IRQ flags from its IORESOURCE_IRQ resource if configured as such, much like it's been done for the smc91x driver.
It spares people writing support for specific boards the burden to configure the interrupt controller independantly, and keeps all IRQ related information in a single resource.
Regards,
M.
Signed-off-by: Marc Zyngier <marc.zyngier@altran.com>
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index ce1ca0b..6eda6f9 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1562,10 +1562,10 @@ static int __devinit isp116x_probe(struct platform_device *pdev) { struct usb_hcd *hcd; struct isp116x *isp116x; - struct resource *addr, *data; + struct resource *addr, *data, *ires; void __iomem *addr_reg; void __iomem *data_reg; - int irq; + int irq, irq_flags; int ret = 0; if (pdev->num_resources < 3) { @@ -1575,12 +1575,16 @@ static int __devinit isp116x_probe(struct platform_device *pdev) data = platform_get_resource(pdev, IORESOURCE_MEM, 0); addr = platform_get_resource(pdev, IORESOURCE_MEM, 1); - irq = platform_get_irq(pdev, 0); - if (!addr || !data || irq < 0) { + ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + + if (!addr || !data || !ires) { ret = -ENODEV; goto err1; } + irq = ires->start; + irq_flags = ires->flags & IRQF_TRIGGER_MASK; + if (pdev->dev.dma_mask) { DBG("DMA not supported\n"); ret = -EINVAL; @@ -1634,7 +1638,7 @@ static int __devinit isp116x_probe(struct platform_device *pdev) goto err6; } - ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); + ret = usb_add_hcd(hcd, irq, irq_flags | IRQF_DISABLED); if (ret) goto err6; -- A rat a day keeps the plague away.
| |