[PATCH] ps3 usb missed the addition of new argument to ps3_alloc_io_irq()
[safe/jmp/linux-2.6] / drivers / usb / host / isp116x-hcd.c
index 8344791..2718b5d 100644 (file)
@@ -63,7 +63,7 @@
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/usb.h>
-#include <linux/usb_isp116x.h>
+#include <linux/usb/isp116x.h>
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
@@ -154,13 +154,11 @@ static void pack_fifo(struct isp116x *isp116x)
        struct ptd *ptd;
        int buflen = isp116x->atl_last_dir == PTD_DIR_IN
            ? isp116x->atl_bufshrt : isp116x->atl_buflen;
-       int ptd_count = 0;
 
        isp116x_write_reg16(isp116x, HCuPINT, HCuPINT_AIIEOT);
        isp116x_write_reg16(isp116x, HCXFERCTR, buflen);
        isp116x_write_addr(isp116x, HCATLPORT | ISP116x_WRITE_OFFSET);
        for (ep = isp116x->atl_active; ep; ep = ep->active) {
-               ++ptd_count;
                ptd = &ep->ptd;
                dump_ptd(ptd);
                dump_ptd_out_data(ptd, ep->data);
@@ -420,7 +418,7 @@ static void postproc_atl_queue(struct isp116x *isp116x)
   processed urbs.
 */
 static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep,
-                          struct urb *urb, struct pt_regs *regs)
+                          struct urb *urb)
 __releases(isp116x->lock) __acquires(isp116x->lock)
 {
        unsigned i;
@@ -434,7 +432,7 @@ __releases(isp116x->lock) __acquires(isp116x->lock)
        urb_dbg(urb, "Finish");
 
        spin_unlock(&isp116x->lock);
-       usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb, regs);
+       usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb);
        spin_lock(&isp116x->lock);
 
        /* take idle endpoints out of the schedule */
@@ -570,7 +568,7 @@ static void start_atl_transfers(struct isp116x *isp116x)
 /*
   Finish the processed transfers
 */
-static void finish_atl_transfers(struct isp116x *isp116x, struct pt_regs *regs)
+static void finish_atl_transfers(struct isp116x *isp116x)
 {
        struct isp116x_ep *ep;
        struct urb *urb;
@@ -592,12 +590,12 @@ static void finish_atl_transfers(struct isp116x *isp116x, struct pt_regs *regs)
                   occured, while URB_SHORT_NOT_OK was set */
                if (urb && urb->status != -EINPROGRESS
                    && ep->nextpid != USB_PID_ACK)
-                       finish_request(isp116x, ep, urb, regs);
+                       finish_request(isp116x, ep, urb);
        }
        atomic_dec(&isp116x->atl_finishing);
 }
 
-static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs)
+static irqreturn_t isp116x_irq(struct usb_hcd *hcd)
 {
        struct isp116x *isp116x = hcd_to_isp116x(hcd);
        u16 irqstat;
@@ -610,7 +608,7 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 
        if (irqstat & (HCuPINT_ATL | HCuPINT_SOF)) {
                ret = IRQ_HANDLED;
-               finish_atl_transfers(isp116x, regs);
+               finish_atl_transfers(isp116x);
        }
 
        if (irqstat & HCuPINT_OPR) {
@@ -726,7 +724,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
                ep = hep->hcpriv;
        else {
                INIT_LIST_HEAD(&ep->schedule);
-               ep->udev = usb_get_dev(udev);
+               ep->udev = udev;
                ep->epnum = epnum;
                ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out);
                usb_settoggle(udev, epnum, is_out, 0);
@@ -783,7 +781,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
                if (ep->branch < PERIODIC_SIZE)
                        break;
 
-               ret = ep->branch = balance(isp116x, ep->period, ep->load);
+               ep->branch = ret = balance(isp116x, ep->period, ep->load);
                if (ret < 0)
                        goto fail;
                ret = 0;
@@ -826,7 +824,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd,
        spin_lock(&urb->lock);
        if (urb->status != -EINPROGRESS) {
                spin_unlock(&urb->lock);
-               finish_request(isp116x, ep, urb, NULL);
+               finish_request(isp116x, ep, urb);
                ret = 0;
                goto fail;
        }
@@ -872,7 +870,7 @@ static int isp116x_urb_dequeue(struct usb_hcd *hcd, struct urb *urb)
                        }
 
        if (urb)
-               finish_request(isp116x, ep, urb, NULL);
+               finish_request(isp116x, ep, urb);
 
        spin_unlock_irqrestore(&isp116x->lock, flags);
        return 0;
@@ -893,7 +891,6 @@ static void isp116x_endpoint_disable(struct usb_hcd *hcd,
        if (!list_empty(&hep->urb_list))
                WARN("ep %p not empty?\n", ep);
 
-       usb_put_dev(ep->udev);
        kfree(ep);
        hep->hcpriv = NULL;
 }
@@ -1207,10 +1204,10 @@ static int isp116x_show_dbg(struct seq_file *s, void *unused)
 
 static int isp116x_open_seq(struct inode *inode, struct file *file)
 {
-       return single_open(file, isp116x_show_dbg, inode->u.generic_ip);
+       return single_open(file, isp116x_show_dbg, inode->i_private);
 }
 
-static struct file_operations isp116x_debug_fops = {
+static const struct file_operations isp116x_debug_fops = {
        .open = isp116x_open_seq,
        .read = seq_read,
        .llseek = seq_lseek,
@@ -1422,20 +1419,22 @@ static int isp116x_bus_suspend(struct usb_hcd *hcd)
        int ret = 0;
 
        spin_lock_irqsave(&isp116x->lock, flags);
-
        val = isp116x_read_reg32(isp116x, HCCONTROL);
+
        switch (val & HCCONTROL_HCFS) {
        case HCCONTROL_USB_OPER:
+               spin_unlock_irqrestore(&isp116x->lock, flags);
                val &= (~HCCONTROL_HCFS & ~HCCONTROL_RWE);
                val |= HCCONTROL_USB_SUSPEND;
                if (device_may_wakeup(&hcd->self.root_hub->dev))
                        val |= HCCONTROL_RWE;
                /* Wait for usb transfers to finish */
-               mdelay(2);
+               msleep(2);
+               spin_lock_irqsave(&isp116x->lock, flags);
                isp116x_write_reg32(isp116x, HCCONTROL, val);
+               spin_unlock_irqrestore(&isp116x->lock, flags);
                /* Wait for devices to suspend */
-               mdelay(5);
-       case HCCONTROL_USB_SUSPEND:
+               msleep(5);
                break;
        case HCCONTROL_USB_RESUME:
                isp116x_write_reg32(isp116x, HCCONTROL,
@@ -1443,12 +1442,11 @@ static int isp116x_bus_suspend(struct usb_hcd *hcd)
                                    HCCONTROL_USB_RESET);
        case HCCONTROL_USB_RESET:
                ret = -EBUSY;
+       default:                /* HCCONTROL_USB_SUSPEND */
+               spin_unlock_irqrestore(&isp116x->lock, flags);
                break;
-       default:
-               ret = -EINVAL;
        }
 
-       spin_unlock_irqrestore(&isp116x->lock, flags);
        return ret;
 }
 
@@ -1554,7 +1552,7 @@ static struct hc_driver isp116x_hc_driver = {
 
 /*----------------------------------------------------------------*/
 
-static int __init_or_module isp116x_remove(struct platform_device *pdev)
+static int isp116x_remove(struct platform_device *pdev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
        struct isp116x *isp116x;
@@ -1655,7 +1653,7 @@ static int __init isp116x_probe(struct platform_device *pdev)
                goto err6;
        }
 
-       ret = usb_add_hcd(hcd, irq, SA_INTERRUPT);
+       ret = usb_add_hcd(hcd, irq, IRQF_DISABLED);
        if (ret)
                goto err6;
 
@@ -1717,9 +1715,9 @@ static struct platform_driver isp116x_driver = {
        .remove = isp116x_remove,
        .suspend = isp116x_suspend,
        .resume = isp116x_resume,
-       .driver = {
-               .name = (char *)hcd_name,
-       },
+       .driver = {
+                  .name = (char *)hcd_name,
+                  },
 };
 
 /*-----------------------------------------------------------------*/