diff options
-rw-r--r-- | drivers/usb/core/usb.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index b975450f403e..a9cf484ecae4 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -122,6 +122,19 @@ static inline int is_usb_device_driver(struct device_driver *drv) | |||
122 | for_devices; | 122 | for_devices; |
123 | } | 123 | } |
124 | 124 | ||
125 | /* translate USB error codes to codes user space understands */ | ||
126 | static inline int usb_translate_errors(int error_code) | ||
127 | { | ||
128 | switch (error_code) { | ||
129 | case 0: | ||
130 | case -ENOMEM: | ||
131 | case -ENODEV: | ||
132 | return error_code; | ||
133 | default: | ||
134 | return -EIO; | ||
135 | } | ||
136 | } | ||
137 | |||
125 | 138 | ||
126 | /* for labeling diagnostics */ | 139 | /* for labeling diagnostics */ |
127 | extern const char *usbcore_name; | 140 | extern const char *usbcore_name; |