Greg:

This patch takes care of some small miscellaneous items in hub.c:

        Move the definition of CONFIG to the right place;

        Print the proper value for submission status in the error log;

        Remove an unused list of all hubs;

        Remove some unneeded braces;

        Kill an accidentally-resurrected comment.

Please apply.

Alan Stern



Signed-off-by: Alan Stern <[EMAIL PROTECTED]>

===== drivers/usb/core/hub.c 1.157 vs edited =====
--- 1.157/drivers/usb/core/hub.c        Tue May 25 12:25:41 2004
+++ edited/drivers/usb/core/hub.c       Tue Jun  1 16:39:04 2004
@@ -9,6 +9,11 @@
  */
 
 #include <linux/config.h>
+#ifdef CONFIG_USB_DEBUG
+       #define DEBUG
+#else
+       #undef DEBUG
+#endif
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -19,11 +24,6 @@
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/ioctl.h>
-#ifdef CONFIG_USB_DEBUG
-       #define DEBUG
-#else
-       #undef DEBUG
-#endif
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/suspend.h>
@@ -40,7 +40,6 @@
 static spinlock_t hub_event_lock = SPIN_LOCK_UNLOCKED;
 
 static LIST_HEAD(hub_event_list);      /* List of hubs needing servicing */
-static LIST_HEAD(hub_list);            /* List of all hubs (for cleanup) */
 
 static DECLARE_WAIT_QUEUE_HEAD(khubd_wait);
 static pid_t khubd_pid = 0;                    /* PID of khubd */
@@ -268,7 +267,7 @@
        if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0
                        /* ENODEV means we raced disconnect() */
                        && status != -ENODEV)
-               dev_err (&hub->intf->dev, "resubmit --> %d\n", urb->status);
+               dev_err (&hub->intf->dev, "resubmit --> %d\n", status);
        if (status == 0)
                hub->urb_active = 1;
 done:
@@ -646,7 +645,6 @@
 
        /* Delete it and then reset it */
        list_del_init(&hub->event_list);
-       list_del_init(&hub->hub_list);
 
        spin_unlock_irqrestore(&hub_event_lock, flags);
 
@@ -695,7 +693,6 @@
        struct usb_device *hdev;
        struct usb_hub *hub;
        struct device *hub_dev;
-       unsigned long flags;
 
        desc = intf->cur_altsetting;
        hdev = interface_to_usbdev(intf);
@@ -711,23 +708,19 @@
        }
 
        /* Multiple endpoints? What kind of mutant ninja-hub is this? */
-       if (desc->desc.bNumEndpoints != 1) {
+       if (desc->desc.bNumEndpoints != 1)
                goto descriptor_error;
-       }
 
        endpoint = &desc->endpoint[0].desc;
 
        /* Output endpoint? Curiouser and curiouser.. */
-       if (!(endpoint->bEndpointAddress & USB_DIR_IN)) {
+       if (!(endpoint->bEndpointAddress & USB_DIR_IN))
                goto descriptor_error;
-       }
 
        /* If it's not an interrupt endpoint, we'd better punt! */
        if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
-                       != USB_ENDPOINT_XFER_INT) {
+                       != USB_ENDPOINT_XFER_INT)
                goto descriptor_error;
-               return -EIO;
-       }
 
        /* We found a hub */
        dev_info (hub_dev, "USB hub found\n");
@@ -745,12 +738,6 @@
        init_MUTEX(&hub->khubd_sem);
        INIT_WORK(&hub->leds, led_work, hub);
 
-       /* Record the new hub's existence */
-       spin_lock_irqsave(&hub_event_lock, flags);
-       INIT_LIST_HEAD(&hub->hub_list);
-       list_add(&hub->hub_list, &hub_list);
-       spin_unlock_irqrestore(&hub_event_lock, flags);
-
        usb_set_intfdata (intf, hub);
 
        if (hdev->speed == USB_SPEED_HIGH)
@@ -1581,9 +1568,6 @@
        .id_table =     hub_id_table,
 };
 
-/*
- * This should be a separate module.
- */
 int usb_hub_init(void)
 {
        pid_t pid;
===== drivers/usb/core/hub.h 1.26 vs edited =====
--- 1.26/drivers/usb/core/hub.h Sat May 15 11:48:05 2004
+++ edited/drivers/usb/core/hub.h       Tue Jun  1 16:31:11 2004
@@ -202,7 +202,6 @@
        int                     error;          /* last reported error */
        int                     nerrors;        /* track consecutive errors */
 
-       struct list_head        hub_list;       /* all hubs */
        struct list_head        event_list;     /* hubs w/data or errs ready */
 
        struct usb_hub_descriptor *descriptor;  /* class descriptor */






-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to