Fix #42 usb_detach_kernel_driver_np() error mapping
Fix #42 usb_detach_kernel_driver_np() error mapping

usb_detach_kernel_driver_np() from libusb-compat-0.1 returns different
error messages than the old libusb-0.1. It causes problems for drivers
that expect exact error code.

Convert libusb-1.0 errors back to libusb-0.1 errors to get 1:1 mapping
of kernel error codes.

Affected software:
lirc-0.8.7/daemons/hw_srm7500libusb.c: srm7500_initialize_usbdongle()
The function continues if usb_detach_kernel_driver_np() finishes with
no error or if it returns -ENODATA. But libusb-compat-0.1 used to
return -ENOENT and the driver considers this error as fatal.

Upstream bug reference:
http://libusb.org/ticket/42
Upstream mailing list reference:
http://marc.info/?m=133355454809642
Downstream bug reference:
https://bugzilla.novell.com/show_bug.cgi?id=683307

BuLogics/libusb-compat-0.1,hjelmn/libusb-compat-0.1,Distrotech/libusb-compat,hjelmn/libusb-compat-0.1,BuLogics/libusb-compat-0.1,BuLogics/libusb-compat-0.1,Distrotech/libusb-compat