aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2011-11-10 08:58:26 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-15 13:47:40 -0500
commit2c4d6bf295ae10ffcd84f0df6cb642598eb66603 (patch)
tree5fd9620f72abbc7f5000709ffbc83794d9d9ab08 /include/linux/usb.h
parentd83b405383c965498923f3561c3321e2b5df5727 (diff)
USB: move usb_translate_errors to linux/usb.h
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>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d3d0c1374334..2f05a7fa1ecf 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1598,6 +1598,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1598 1598
1599/* ----------------------------------------------------------------------- */ 1599/* ----------------------------------------------------------------------- */
1600 1600
1601/* translate USB error codes to codes user space understands */
1602static inline int usb_translate_errors(int error_code)
1603{
1604 switch (error_code) {
1605 case 0:
1606 case -ENOMEM:
1607 case -ENODEV:
1608 return error_code;
1609 default:
1610 return -EIO;
1611 }
1612}
1613
1601/* Events from the usb core */ 1614/* Events from the usb core */
1602#define USB_DEVICE_ADD 0x0001 1615#define USB_DEVICE_ADD 0x0001
1603#define USB_DEVICE_REMOVE 0x0002 1616#define USB_DEVICE_REMOVE 0x0002