uas: Move uas_find_endpoints to uas-detect.h
authorHans de Goede <hdegoede@redhat.com>
Tue, 29 Oct 2013 09:03:34 +0000 (10:03 +0100)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 4 Mar 2014 23:38:18 +0000 (15:38 -0800)
No changes, just the move.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/storage/uas-detect.h
drivers/usb/storage/uas.c

index 082bde1fa74d6494a6ba1cf9c3b08896440127d8..8de030a0a4a4532716d95077cc1815449cbf517c 100644 (file)
@@ -40,6 +40,33 @@ static int uas_find_uas_alt_setting(struct usb_interface *intf)
        return -ENODEV;
 }
 
+static int uas_find_endpoints(struct usb_host_interface *alt,
+                             struct usb_host_endpoint *eps[])
+{
+       struct usb_host_endpoint *endpoint = alt->endpoint;
+       unsigned i, n_endpoints = alt->desc.bNumEndpoints;
+
+       for (i = 0; i < n_endpoints; i++) {
+               unsigned char *extra = endpoint[i].extra;
+               int len = endpoint[i].extralen;
+               while (len >= 3) {
+                       if (extra[1] == USB_DT_PIPE_USAGE) {
+                               unsigned pipe_id = extra[2];
+                               if (pipe_id > 0 && pipe_id < 5)
+                                       eps[pipe_id - 1] = &endpoint[i];
+                               break;
+                       }
+                       len -= extra[0];
+                       extra += extra[0];
+               }
+       }
+
+       if (!eps[0] || !eps[1] || !eps[2] || !eps[3])
+               return -ENODEV;
+
+       return 0;
+}
+
 static int uas_use_uas_driver(struct usb_interface *intf,
                              const struct usb_device_id *id)
 {
index 7662b3e13c4dc305e64fc7d93360b00fff59f1cf..5cedc7f034b6ae92f2309e6ffbe3e082e7abc923 100644 (file)
@@ -898,33 +898,6 @@ static int uas_switch_interface(struct usb_device *udev,
                        intf->altsetting[0].desc.bInterfaceNumber, alt);
 }
 
-static int uas_find_endpoints(struct usb_host_interface *alt,
-                             struct usb_host_endpoint *eps[])
-{
-       struct usb_host_endpoint *endpoint = alt->endpoint;
-       unsigned i, n_endpoints = alt->desc.bNumEndpoints;
-
-       for (i = 0; i < n_endpoints; i++) {
-               unsigned char *extra = endpoint[i].extra;
-               int len = endpoint[i].extralen;
-               while (len >= 3) {
-                       if (extra[1] == USB_DT_PIPE_USAGE) {
-                               unsigned pipe_id = extra[2];
-                               if (pipe_id > 0 && pipe_id < 5)
-                                       eps[pipe_id - 1] = &endpoint[i];
-                               break;
-                       }
-                       len -= extra[0];
-                       extra += extra[0];
-               }
-       }
-
-       if (!eps[0] || !eps[1] || !eps[2] || !eps[3])
-               return -ENODEV;
-
-       return 0;
-}
-
 static void uas_configure_endpoints(struct uas_dev_info *devinfo)
 {
        struct usb_host_endpoint *eps[4] = { };