diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-01-28 07:21:46 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-01-28 07:21:46 +0000 |
commit | caab93f6314fd8f49d5513d44e57afded482e421 (patch) | |
tree | 488d602f7226a52a86e9c7cad0949a3e470ae571 /lib | |
parent | 800e6812e23ec71bb85478a55edf8f7b7a106a0b (diff) | |
download | FreeBSD-src-caab93f6314fd8f49d5513d44e57afded482e421.zip FreeBSD-src-caab93f6314fd8f49d5513d44e57afded482e421.tar.gz |
Comply to the official LibUSB v1.0 API:
"It is legal to attempt to claim an already-claimed interface."
MFC after: 1 week
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libusb/libusb10.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 79a570e..c795ecf 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -611,7 +611,6 @@ int libusb_claim_interface(struct libusb20_device *pdev, int interface_number) { libusb_device *dev; - int err = 0; dev = libusb_get_device(pdev); if (dev == NULL) @@ -621,13 +620,10 @@ libusb_claim_interface(struct libusb20_device *pdev, int interface_number) return (LIBUSB_ERROR_INVALID_PARAM); CTX_LOCK(dev->ctx); - if (dev->claimed_interfaces & (1 << interface_number)) - err = LIBUSB_ERROR_BUSY; - - if (!err) - dev->claimed_interfaces |= (1 << interface_number); + dev->claimed_interfaces |= (1 << interface_number); CTX_UNLOCK(dev->ctx); - return (err); + + return (0); } int |