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: Sun, 03 Apr 2005 21:39:25 +0100
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/04/03 21:39:19

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

Log message:
        Fixup 2.6.12-rc1.

diff -urN linux/drivers/usb/host/ohci-au1xxx.c 
linux/drivers/usb/host/ohci-au1xxx.c
--- linux/drivers/usb/host/ohci-au1xxx.c        2005/03/18 17:37:49     1.4
+++ linux/drivers/usb/host/ohci-au1xxx.c        2005/04/03 20:39:19     1.5
@@ -84,97 +84,48 @@
  *
  */
 int usb_hcd_au1xxx_probe (const struct hc_driver *driver,
-                         struct usb_hcd **hcd_out,
                          struct platform_device *dev)
 {
        int retval;
-       struct usb_hcd *hcd = 0;
-
-       unsigned int *addr = NULL;
-
-       if (!request_mem_region(dev->resource[0].start,
-                               dev->resource[0].end
-                               - dev->resource[0].start + 1, hcd_name)) {
-               pr_debug("request_mem_region failed");
-               return -EBUSY;
-       }
-       
-       au1xxx_start_hc(dev);
-       
-       addr = ioremap(dev->resource[0].start,
-                      dev->resource[0].end
-                      - dev->resource[0].start + 1);
-       if (!addr) {
-               pr_debug("ioremap failed");
-               retval = -ENOMEM;
-               goto out_release;
-       }
+       struct usb_hcd *hcd;
 
        if (dev->resource[1].flags != IORESOURCE_IRQ) {
                pr_debug ("resource[1] is not IORESOURCE_IRQ");
                retval = -ENOMEM;
-               goto out_iounmap;
-       }
-
-       hcd = usb_create_hcd(driver);
-       if (hcd == NULL) {
-               pr_debug ("usb_create_hcd failed");
-               retval = -ENOMEM;
-               goto out_iounmap;
        }
-       ohci_hcd_init(hcd_to_ohci(hcd));
 
-       hcd->irq = dev->resource[1].start;
-       hcd->regs = addr;
-       hcd->self.controller = &dev->dev;
-
-       retval = hcd_buffer_create (hcd);
-       if (retval != 0) {
-               pr_debug ("pool alloc fail");
-               goto out_put_hcd;
-       }
+       hcd = usb_create_hcd(driver, &dev->dev, "Au1xxx");
+       if (!hcd)
+               return -ENOMEM;
+       hcd->rsrc_start = dev->resource[0].start;
+       hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
 
-       retval = request_irq (hcd->irq, usb_hcd_au1xxx_hcim_irq, SA_INTERRUPT,
-                             hcd->driver->description, hcd);
-       if (retval != 0) {
-               pr_debug("request_irq failed");
+       if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+               pr_debug("request_mem_region failed");
                retval = -EBUSY;
-               goto out_free_buffer;
+               goto err1;
        }
 
-       pr_debug ("%s (Au1xxx) at 0x%p, irq %d",
-            hcd->driver->description, hcd->regs, hcd->irq);
-
-       hcd->self.bus_name = "au1xxx";
-
-       if ((retval = usb_register_bus(&hcd->self)))
-               goto out_free_irq;
-
-       if ((retval = driver->start(hcd)) < 0) {
-               usb_hcd_au1xxx_remove(hcd, dev);
-               printk("bad driver->start\n");
-               return retval;
+       hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+       if (!hcd->regs) {
+               pr_debug("ioremap failed");
+               retval = -ENOMEM;
+               goto err2;
        }
 
-       *hcd_out = hcd;
+       au1xxx_start_hc(dev);
+       ohci_hcd_init(hcd_to_ohci(hcd));
 
-       return 0;
+       retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT);
+       if (retval == 0)
+               return retval;
 
-out_unregister_bus:
-       usb_deregister_bus(&hcd->self);
-out_free_irq:
-       free_irq(hcd->irq, hcd);
-out_free_buffer:
-       hcd_buffer_destroy (hcd);
-out_put_hcd:
-       usb_put_hcd(hcd);
-out_iounmap:
-       iounmap(addr);
-out_release:
        au1xxx_stop_hc(dev);
-       release_mem_region(dev->resource[0].start,
-                               dev->resource[0].end
-                          - dev->resource[0].start + 1);
+       iounmap(hcd->regs);
+ err2:
+       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ err1:
+       usb_put_hcd(hcd);
        return retval;
 }
 

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