]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: move usb_translate_errors to linux/usb.h
authorJohan Hovold <jhovold@gmail.com>
Thu, 10 Nov 2011 13:58:26 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Nov 2011 18:47:40 +0000 (10:47 -0800)
Move usb_translate_errors from usb core to linux/usb.h as it is meant to
be accessed from drivers.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/usb.h
include/linux/usb.h

index 3888778582c4f154ace30f6efa41344cab5f901e..45e8479c377ddb66e4cfd387ad184d8b301b4b4e 100644 (file)
@@ -132,20 +132,6 @@ static inline int is_usb_device_driver(struct device_driver *drv)
                        for_devices;
 }
 
-/* translate USB error codes to codes user space understands */
-static inline int usb_translate_errors(int error_code)
-{
-       switch (error_code) {
-       case 0:
-       case -ENOMEM:
-       case -ENODEV:
-               return error_code;
-       default:
-               return -EIO;
-       }
-}
-
-
 /* for labeling diagnostics */
 extern const char *usbcore_name;
 
index d3d0c1374334d58c684e5f1b4d13422aa8f57ae8..2f05a7fa1ecfb9b038991b71fd523598246e15a2 100644 (file)
@@ -1598,6 +1598,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
 
 /* ----------------------------------------------------------------------- */
 
+/* translate USB error codes to codes user space understands */
+static inline int usb_translate_errors(int error_code)
+{
+       switch (error_code) {
+       case 0:
+       case -ENOMEM:
+       case -ENODEV:
+               return error_code;
+       default:
+               return -EIO;
+       }
+}
+
 /* Events from the usb core */
 #define USB_DEVICE_ADD         0x0001
 #define USB_DEVICE_REMOVE      0x0002