ARM: 5682/1: Add cpu.c and dev.c and modify some files of w90p910 platform
[safe/jmp/linux-2.6] / drivers / usb / host / isp116x-hcd.c
index ce1ca0b..a2b3054 100644 (file)
@@ -772,7 +772,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
                break;
        case PIPE_INTERRUPT:
                urb->interval = ep->period;
-               ep->length = min((int)ep->maxpacket,
+               ep->length = min_t(u32, ep->maxpacket,
                                 urb->transfer_buffer_length);
 
                /* urb submitted for already existing endpoint */
@@ -1562,11 +1562,12 @@ 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 ret = 0;
+       unsigned long irqflags;
 
        if (pdev->num_resources < 3) {
                ret = -ENODEV;
@@ -1575,12 +1576,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;
+       irqflags = ires->flags & IRQF_TRIGGER_MASK;
+
        if (pdev->dev.dma_mask) {
                DBG("DMA not supported\n");
                ret = -EINVAL;
@@ -1634,7 +1639,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, irqflags | IRQF_DISABLED);
        if (ret)
                goto err6;