linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ppopov@linux-mips.org
Date: Tue, 18 Jan 2005 05:19:07 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ppopov@ftp.linux-mips.org       05/01/18 05:19:01

Modified files:
        drivers/usb/host: ohci-au1xxx.c 

Log message:
        USB build fixes.

diff -urN linux/drivers/usb/host/ohci-au1xxx.c 
linux/drivers/usb/host/ohci-au1xxx.c
--- linux/drivers/usb/host/ohci-au1xxx.c        2004/11/22 00:44:19     1.2
+++ linux/drivers/usb/host/ohci-au1xxx.c        2005/01/18 05:19:01     1.3
@@ -64,7 +64,7 @@
               ": stopping Au1xxx OHCI USB Controller\n");
 
        /* Disable clock */
-       au_writel(readl(USB_HOST_CONFIG) & ~USBH_ENABLE_CE, USB_HOST_CONFIG);
+       au_writel(readl((void *)USB_HOST_CONFIG) & ~USBH_ENABLE_CE, 
USB_HOST_CONFIG);
 }
 
 
@@ -122,23 +122,21 @@
                retval = -ENOMEM;
                goto err1;
        }
-       
 
-       hcd = driver->hcd_alloc ();
-       if (hcd == NULL){
-               pr_debug ("hcd_alloc failed");
+       if(dev->resource[1].flags != IORESOURCE_IRQ) {
+               pr_debug ("resource[1] is not IORESOURCE_IRQ");
                retval = -ENOMEM;
                goto err1;
        }
 
-       if(dev->resource[1].flags != IORESOURCE_IRQ){
-               pr_debug ("resource[1] is not IORESOURCE_IRQ");
+       hcd = usb_create_hcd(driver);
+       if (hcd == NULL) {
+               pr_debug ("usb_create_hcd failed");
                retval = -ENOMEM;
                goto err1;
        }
+       ohci_hcd_init(hcd_to_ohci(hcd));
 
-       hcd->driver = (struct hc_driver *) driver;
-       hcd->description = driver->description;
        hcd->irq = dev->resource[1].start;
        hcd->regs = addr;
        hcd->self.controller = &dev->dev;
@@ -146,27 +144,21 @@
        retval = hcd_buffer_create (hcd);
        if (retval != 0) {
                pr_debug ("pool alloc fail");
-               goto err1;
+               goto err2;
        }
 
        retval = request_irq (hcd->irq, usb_hcd_au1xxx_hcim_irq, SA_INTERRUPT,
-                             hcd->description, hcd);
+                             hcd->driver->description, hcd);
        if (retval != 0) {
                pr_debug("request_irq failed");
                retval = -EBUSY;
-               goto err2;
+               goto err3;
        }
 
        pr_debug ("%s (Au1xxx) at 0x%p, irq %d",
-            hcd->description, hcd->regs, hcd->irq);
+            hcd->driver->description, hcd->regs, hcd->irq);
 
-       usb_bus_init (&hcd->self);
-       hcd->self.op = &usb_hcd_operations;
-       hcd->self.hcpriv = (void *) hcd;
        hcd->self.bus_name = "au1xxx";
-       hcd->product_desc = "Au1xxx OHCI";
-
-       INIT_LIST_HEAD (&hcd->dev_list);
 
        usb_register_bus (&hcd->self);
 
@@ -180,10 +172,11 @@
        *hcd_out = hcd;
        return 0;
 
- err2:
+ err3:
        hcd_buffer_destroy (hcd);
+ err2:
+       usb_put_hcd(hcd);
  err1:
-       kfree(hcd);
        au1xxx_stop_hc(dev);
        release_mem_region(dev->resource[0].start,
                                dev->resource[0].end
@@ -245,7 +238,7 @@
                return ret;
 
        if ((ret = ohci_run (ohci)) < 0) {
-               err ("can't start %s", ohci->hcd.self.bus_name);
+               err ("can't start %s", hcd->self.bus_name);
                ohci_stop (hcd);
                return ret;
        }
@@ -257,6 +250,8 @@
 
 static const struct hc_driver ohci_au1xxx_hc_driver = {
        .description =          hcd_name,
+       .product_desc =         "Au1xxx OHCI",
+       .hcd_priv_size =        sizeof(struct ohci_hcd),
 
        /*
         * generic hardware linkage
@@ -275,11 +270,6 @@
        .stop =                 ohci_stop,
 
        /*
-        * memory lifecycle (except per-request)
-        */
-       .hcd_alloc =            ohci_hcd_alloc,
-
-       /*
         * managing i/o requests and associated device resources
         */
        .urb_enqueue =          ohci_urb_enqueue,

<Prev in Thread] Current Thread [Next in Thread>