Message ID | 201006081612.03253.oliver@neukum.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index cd88220..b070549 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -124,6 +124,18 @@ static inline int is_usb_device_driver(struct device_driver *drv) 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 */ extern const char *usbcore_name;