diff options
author | Lothar Wassmann <LW@KARO-electronics.de> | 2010-01-15 14:42:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-20 18:24:36 -0500 |
commit | 0a2fea2e0dea9df8ead1cb45e4b9cd68e1b1d29b (patch) | |
tree | bda5ff5da128b3a79ef9cc68ef60b1aa9e3e235e /drivers/usb/host | |
parent | 96b85179b464cc80d85b5c602af119d1dd6d50bb (diff) |
USB: isp1362: fix build failure on ARM systems via irq_flags cleanup
There was some left over #ifdef ARM logic that is outdated but no one
really noticed. So instead of relying on this tricky logic, properly
load and utilize the platform irq_flags resources.
Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/isp1362-hcd.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c index 8d3104441f16..42971657fde2 100644 --- a/drivers/usb/host/isp1362-hcd.c +++ b/drivers/usb/host/isp1362-hcd.c | |||
@@ -2697,6 +2697,8 @@ static int __init isp1362_probe(struct platform_device *pdev) | |||
2697 | void __iomem *data_reg; | 2697 | void __iomem *data_reg; |
2698 | int irq; | 2698 | int irq; |
2699 | int retval = 0; | 2699 | int retval = 0; |
2700 | struct resource *irq_res; | ||
2701 | unsigned int irq_flags = 0; | ||
2700 | 2702 | ||
2701 | /* basic sanity checks first. board-specific init logic should | 2703 | /* basic sanity checks first. board-specific init logic should |
2702 | * have initialized this the three resources and probably board | 2704 | * have initialized this the three resources and probably board |
@@ -2710,11 +2712,12 @@ static int __init isp1362_probe(struct platform_device *pdev) | |||
2710 | 2712 | ||
2711 | data = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2713 | data = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2712 | addr = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 2714 | addr = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
2713 | irq = platform_get_irq(pdev, 0); | 2715 | irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
2714 | if (!addr || !data || irq < 0) { | 2716 | if (!addr || !data || !irq_res) { |
2715 | retval = -ENODEV; | 2717 | retval = -ENODEV; |
2716 | goto err1; | 2718 | goto err1; |
2717 | } | 2719 | } |
2720 | irq = irq_res->start; | ||
2718 | 2721 | ||
2719 | #ifdef CONFIG_USB_HCD_DMA | 2722 | #ifdef CONFIG_USB_HCD_DMA |
2720 | if (pdev->dev.dma_mask) { | 2723 | if (pdev->dev.dma_mask) { |
@@ -2781,12 +2784,16 @@ static int __init isp1362_probe(struct platform_device *pdev) | |||
2781 | } | 2784 | } |
2782 | #endif | 2785 | #endif |
2783 | 2786 | ||
2784 | #ifdef CONFIG_ARM | 2787 | if (irq_res->flags & IORESOURCE_IRQ_HIGHEDGE) |
2785 | if (isp1362_hcd->board) | 2788 | irq_flags |= IRQF_TRIGGER_RISING; |
2786 | set_irq_type(irq, isp1362_hcd->board->int_act_high ? IRQT_RISING : IRQT_FALLING); | 2789 | if (irq_res->flags & IORESOURCE_IRQ_LOWEDGE) |
2787 | #endif | 2790 | irq_flags |= IRQF_TRIGGER_FALLING; |
2791 | if (irq_res->flags & IORESOURCE_IRQ_HIGHLEVEL) | ||
2792 | irq_flags |= IRQF_TRIGGER_HIGH; | ||
2793 | if (irq_res->flags & IORESOURCE_IRQ_LOWLEVEL) | ||
2794 | irq_flags |= IRQF_TRIGGER_LOW; | ||
2788 | 2795 | ||
2789 | retval = usb_add_hcd(hcd, irq, IRQF_TRIGGER_LOW | IRQF_DISABLED | IRQF_SHARED); | 2796 | retval = usb_add_hcd(hcd, irq, irq_flags | IRQF_DISABLED | IRQF_SHARED); |
2790 | if (retval != 0) | 2797 | if (retval != 0) |
2791 | goto err6; | 2798 | goto err6; |
2792 | pr_info("%s, irq %d\n", hcd->product_desc, irq); | 2799 | pr_info("%s, irq %d\n", hcd->product_desc, irq); |