Commit 0a2fea2e authored by Lothar Wassmann's avatar Lothar Wassmann Committed by Greg Kroah-Hartman
Browse files

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: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarLothar Wassmann <LW@KARO-electronics.de>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 96b85179
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -2697,6 +2697,8 @@ static int __init isp1362_probe(struct platform_device *pdev)
	void __iomem *data_reg;
	void __iomem *data_reg;
	int irq;
	int irq;
	int retval = 0;
	int retval = 0;
	struct resource *irq_res;
	unsigned int irq_flags = 0;


	/* basic sanity checks first.  board-specific init logic should
	/* basic sanity checks first.  board-specific init logic should
	 * have initialized this the three resources and probably board
	 * have initialized this the three resources and probably board
@@ -2710,11 +2712,12 @@ static int __init isp1362_probe(struct platform_device *pdev)


	data = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	data = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	addr = platform_get_resource(pdev, IORESOURCE_MEM, 1);
	addr = platform_get_resource(pdev, IORESOURCE_MEM, 1);
	irq = platform_get_irq(pdev, 0);
	irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
	if (!addr || !data || irq < 0) {
	if (!addr || !data || !irq_res) {
		retval = -ENODEV;
		retval = -ENODEV;
		goto err1;
		goto err1;
	}
	}
	irq = irq_res->start;


#ifdef CONFIG_USB_HCD_DMA
#ifdef CONFIG_USB_HCD_DMA
	if (pdev->dev.dma_mask) {
	if (pdev->dev.dma_mask) {
@@ -2781,12 +2784,16 @@ static int __init isp1362_probe(struct platform_device *pdev)
	}
	}
#endif
#endif


#ifdef CONFIG_ARM
	if (irq_res->flags & IORESOURCE_IRQ_HIGHEDGE)
	if (isp1362_hcd->board)
		irq_flags |= IRQF_TRIGGER_RISING;
		set_irq_type(irq, isp1362_hcd->board->int_act_high ? IRQT_RISING : IRQT_FALLING);
	if (irq_res->flags & IORESOURCE_IRQ_LOWEDGE)
#endif
		irq_flags |= IRQF_TRIGGER_FALLING;
	if (irq_res->flags & IORESOURCE_IRQ_HIGHLEVEL)
		irq_flags |= IRQF_TRIGGER_HIGH;
	if (irq_res->flags & IORESOURCE_IRQ_LOWLEVEL)
		irq_flags |= IRQF_TRIGGER_LOW;


	retval = usb_add_hcd(hcd, irq, IRQF_TRIGGER_LOW | IRQF_DISABLED | IRQF_SHARED);
	retval = usb_add_hcd(hcd, irq, irq_flags | IRQF_DISABLED | IRQF_SHARED);
	if (retval != 0)
	if (retval != 0)
		goto err6;
		goto err6;
	pr_info("%s, irq %d\n", hcd->product_desc, irq);
	pr_info("%s, irq %d\n", hcd->product_desc, irq);