On Wed, 13 Oct 2010, Oliver Neukum wrote: > Hi, > > drivers need to return errors to user space. > A common source for them are urb->status and the > return value of usb_submit_urb(). They cannot be returned as > is to user space, as for example -EPIPE has a very > different meaning in user space. I'd like to add this small > helper for conversion. > What do you think? > > Regards > Oliver > > > +/* 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; > + } > +} Should this be a non-inline function? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html