From c91da92ef2983ab3d50f5d6e5cbaf993fece6339 Mon Sep 17 00:00:00 2001 From: Wolfgang Wiedmeyer Date: Sun, 5 Feb 2017 21:44:51 +0100 Subject: drivers: Backport cdc-wdm and new qmi_wwan Backport is based on Aleksander Morgado's backport for OpenWrt to the 3.2 kernel[1], so it's a backport of a backport. I added the device IDs for MDM9x15. [1] https://gitorious.org/lanedo/linux-stable?p=lanedo:linux-stable.git;a=shortlog;h=refs/heads/v3.2.5-qmi Signed-off-by: Wolfgang Wiedmeyer --- include/linux/usb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/linux/usb.h') diff --git a/include/linux/usb.h b/include/linux/usb.h index eecfc67e..b639d84 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1605,6 +1605,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 -- cgit v1.1