Re: [PATCH v2 4/9] backports: add usb_translate_errors()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/14/2013 10:18 AM, Patrick Ziegler wrote:
> This inline function is missing for version < 2.6.39 but required by em28xx
> and cdc-wdm device driver.
> 
> Signed-off-by: Patrick Ziegler <patrick.ziegler@xxxxxxxx>
> ---
>  backport/backport-include/linux/usb.h | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h
> index 368da6c..49a5762 100644
> --- a/backport/backport-include/linux/usb.h
> +++ b/backport/backport-include/linux/usb.h
> @@ -145,4 +145,21 @@ extern void usb_unpoison_urb(struct urb *urb);
>  extern int usb_anchor_empty(struct usb_anchor *anchor);
>  #endif /* 2.6.23-2.6.27 */
>  
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
> +#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)

This check for CONFIG_USB is not needed, remove it.

> +static inline int usb_translate_errors(int error_code)
> +{
> +	switch (error_code) {
> +	case 0:
> +	case -ENOMEM:
> +	case -ENODEV:
> +	case -EOPNOTSUPP:
> +		return error_code;
> +	default:
> +		return -EIO;
> +	}
> +}
> +#endif /* CONFIG_USB */
> +#endif /* < 2.6.39 */
> +
>  #endif /* __BACKPORT_USB_H */
> 

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux