Comply to the official LibUSB v1.0 API:
"It is legal to attempt to claim an already-claimed interface." MFC after: 1 week
This commit is contained in:
parent
c297f0e497
commit
7766d56803
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261224
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user