diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-10-10 16:13:33 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-10-10 16:13:33 +0000 |
commit | d4695c896c6faaa2da74b8f02bc43c54800738c5 (patch) | |
tree | c38887b856e8770d00fac439fd8b9aeeaa5f79de /lib/libusb/libusb10.c | |
parent | 09089cc9ae9e4f73f43eda7d6b9dac8a2a1a0707 (diff) | |
download | FreeBSD-src-d4695c896c6faaa2da74b8f02bc43c54800738c5.zip FreeBSD-src-d4695c896c6faaa2da74b8f02bc43c54800738c5.tar.gz |
Fix how libusb20_dev_kernel_driver_active() and
libusb_dev_kernel_driver_active() works. In case of
libusb20 the manpage was wrong and in case of
libusb10 the implementation was wrong.
Submitted by: Kai Wang
MFC after: 3 days
Diffstat (limited to 'lib/libusb/libusb10.c')
-rw-r--r-- | lib/libusb/libusb10.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index e02b90a..0a7c1e6 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -216,7 +216,6 @@ libusb_get_device_list(libusb_context *ctx, libusb_device ***list) libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } - /* get device into libUSB v1.0 list */ libusb20_be_dequeue_device(usb_backend, pdev); @@ -718,8 +717,10 @@ libusb_kernel_driver_active(struct libusb20_device *pdev, int interface) if (pdev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - return (libusb20_dev_kernel_driver_active( - pdev, interface)); + if (libusb20_dev_kernel_driver_active(pdev, interface)) + return (0); /* no kernel driver is active */ + else + return (1); /* kernel driver is active */ } int |