ChangeSet 1.2181.4.38, 2005/03/18 15:08:47-08:00, [EMAIL PROTECTED]

        [PATCH] USBcore updates
        
        This is the first of five updates to usbcore:
        
                Merge the hcd_register_root macro with the usb_register_root_hub
                function.  This is part of the ongoing campaign to flatten out
                the hcd glue layer.
        
        Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 core/hcd.c         |   21 +++++++++++++++------
 core/hcd.h         |   21 ++-------------------
 gadget/dummy_hcd.c |    2 +-
 host/ehci-hcd.c    |    2 +-
 host/ohci-hcd.c    |    2 +-
 host/sl811-hcd.c   |    2 +-
 host/uhci-hcd.c    |    2 +-
 7 files changed, 22 insertions(+), 30 deletions(-)


diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.c    2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/core/hcd.c    2005-03-30 15:12:11 -08:00
@@ -755,7 +755,7 @@
  * Assigns a bus number, and links the controller into usbcore data
  * structures so that it can be seen by scanning the bus list.
  */
-int usb_register_bus(struct usb_bus *bus)
+static int usb_register_bus(struct usb_bus *bus)
 {
        int busnum;
        int retval;
@@ -799,7 +799,7 @@
  * Recycles the bus number, and unlinks the controller from usbcore data
  * structures so that it won't be seen by scanning the bus list.
  */
-void usb_deregister_bus (struct usb_bus *bus)
+static void usb_deregister_bus (struct usb_bus *bus)
 {
        dev_info (bus->controller, "USB bus %d deregistered\n", bus->busnum);
 
@@ -821,9 +821,9 @@
 }
 
 /**
- * usb_register_root_hub - called by HCD to register its root hub 
+ * usb_hcd_register_root_hub - called by HCD to register its root hub 
  * @usb_dev: the usb root hub device to be registered.
- * @parent_dev: the parent device of this root hub.
+ * @hcd: host controller for this root hub
  *
  * The USB host controller calls this function to register the root hub
  * properly with the USB subsystem.  It sets up the device properly in
@@ -831,11 +831,20 @@
  * then calls usb_new_device() to register the usb device.  It also
  * assigns the root hub's USB address (always 1).
  */
-int usb_register_root_hub (struct usb_device *usb_dev, struct device 
*parent_dev)
+int usb_hcd_register_root_hub (struct usb_device *usb_dev, struct usb_hcd *hcd)
 {
+       struct device *parent_dev = hcd->self.controller;
        const int devnum = 1;
        int retval;
 
+       /* hcd->driver->start() reported can_wakeup, probably with
+        * assistance from board's boot firmware.
+        * NOTE:  normal devices won't enable wakeup by default.
+        */
+       if (hcd->can_wakeup)
+               dev_dbg (parent_dev, "supports USB remote wakeup\n");
+       hcd->remote_wakeup = hcd->can_wakeup;
+
        usb_dev->devnum = devnum;
        usb_dev->bus->devnum_next = devnum + 1;
        memset (&usb_dev->bus->devmap.devicemap, 0,
@@ -867,7 +876,7 @@
        up (&usb_bus_list_lock);
        return retval;
 }
-EXPORT_SYMBOL (usb_register_root_hub);
+EXPORT_SYMBOL_GPL(usb_hcd_register_root_hub);
 
 
 /*-------------------------------------------------------------------------*/
diff -Nru a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
--- a/drivers/usb/core/hcd.h    2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/core/hcd.h    2005-03-30 15:12:11 -08:00
@@ -339,25 +339,8 @@
 
 extern struct usb_bus *usb_alloc_bus (struct usb_operations *);
 
-extern int usb_register_bus (struct usb_bus *);
-extern void usb_deregister_bus (struct usb_bus *);
-
-extern int usb_register_root_hub (struct usb_device *usb_dev,
-               struct device *parent_dev);
-
-static inline int hcd_register_root (struct usb_device *usb_dev,
-               struct usb_hcd *hcd)
-{
-       /* hcd->driver->start() reported can_wakeup, probably with
-        * assistance from board's boot firmware.
-        * NOTE:  normal devices won't enable wakeup by default.
-        */
-       if (hcd->can_wakeup)
-               dev_dbg (hcd->self.controller, "supports USB remote wakeup\n");
-       hcd->remote_wakeup = hcd->can_wakeup;
-
-       return usb_register_root_hub (usb_dev, hcd->self.controller);
-}
+extern int usb_hcd_register_root_hub (struct usb_device *usb_dev,
+               struct usb_hcd *hcd);
 
 extern void usb_set_device_state(struct usb_device *udev,
                enum usb_device_state new_state);
diff -Nru a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
--- a/drivers/usb/gadget/dummy_hcd.c    2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/gadget/dummy_hcd.c    2005-03-30 15:12:11 -08:00
@@ -1651,7 +1651,7 @@
        root->speed = USB_SPEED_HIGH;
 
        /* ...then configured, so khubd sees us. */
-       if ((retval = hcd_register_root (root, hcd)) != 0) {
+       if ((retval = usb_hcd_register_root_hub (root, hcd)) != 0) {
                goto err1;
        }
 
diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
--- a/drivers/usb/host/ehci-hcd.c       2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/host/ehci-hcd.c       2005-03-30 15:12:11 -08:00
@@ -635,7 +635,7 @@
         * Before this point the HC was idle/ready.  After, khubd
         * and device drivers may start it running.
         */
-       if (first && hcd_register_root (udev, hcd) != 0) {
+       if (first && usb_hcd_register_root_hub (udev, hcd) != 0) {
                if (hcd->state == USB_STATE_RUNNING)
                        ehci_quiesce (ehci);
                ehci_reset (ehci);
diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
--- a/drivers/usb/host/ohci-hcd.c       2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/host/ohci-hcd.c       2005-03-30 15:12:11 -08:00
@@ -675,7 +675,7 @@
        }
 
        udev->speed = USB_SPEED_FULL;
-       if (hcd_register_root (udev, ohci_to_hcd(ohci)) != 0) {
+       if (usb_hcd_register_root_hub (udev, ohci_to_hcd(ohci)) != 0) {
                usb_put_dev (udev);
                disable (ohci);
                ohci->hc_control &= ~OHCI_CTRL_HCFS;
diff -Nru a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
--- a/drivers/usb/host/sl811-hcd.c      2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/host/sl811-hcd.c      2005-03-30 15:12:11 -08:00
@@ -1567,7 +1567,7 @@
        if (sl811->board)
                hcd->can_wakeup = sl811->board->can_wakeup;
 
-       if (hcd_register_root(udev, hcd) != 0) {
+       if (usb_hcd_register_root_hub(udev, hcd) != 0) {
                usb_put_dev(udev);
                sl811h_stop(hcd);
                return -ENODEV;
diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
--- a/drivers/usb/host/uhci-hcd.c       2005-03-30 15:12:11 -08:00
+++ b/drivers/usb/host/uhci-hcd.c       2005-03-30 15:12:11 -08:00
@@ -680,7 +680,7 @@
 
        udev->speed = USB_SPEED_FULL;
 
-       if (hcd_register_root(udev, hcd) != 0) {
+       if (usb_hcd_register_root_hub(udev, hcd) != 0) {
                dev_err(uhci_dev(uhci), "unable to start root hub\n");
                retval = -ENOMEM;
                goto err_start_root_hub;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to