提交 2c4d6bf2 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

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: NJohan Hovold <jhovold@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d83b4053
...@@ -132,20 +132,6 @@ static inline int is_usb_device_driver(struct device_driver *drv) ...@@ -132,20 +132,6 @@ static inline int is_usb_device_driver(struct device_driver *drv)
for_devices; 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 */ /* for labeling diagnostics */
extern const char *usbcore_name; extern const char *usbcore_name;
......
...@@ -1598,6 +1598,19 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out) ...@@ -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 */ /* Events from the usb core */
#define USB_DEVICE_ADD 0x0001 #define USB_DEVICE_ADD 0x0001
#define USB_DEVICE_REMOVE 0x0002 #define USB_DEVICE_REMOVE 0x0002
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册