Date: Tue, 4 Feb 2014 08:59:03 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r261474 - stable/9/lib/libusb Message-ID: <201402040859.s148x3ZU063035@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Tue Feb 4 08:59:02 2014 New Revision: 261474 URL: http://svnweb.freebsd.org/changeset/base/261474 Log: MFC r261224: Comply to the official LibUSB v1.0 API: "It is legal to attempt to claim an already-claimed interface." Modified: stable/9/lib/libusb/libusb10.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libusb/ (props changed) Modified: stable/9/lib/libusb/libusb10.c ============================================================================== --- stable/9/lib/libusb/libusb10.c Tue Feb 4 08:58:12 2014 (r261473) +++ stable/9/lib/libusb/libusb10.c Tue Feb 4 08:59:02 2014 (r261474) @@ -605,7 +605,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) @@ -615,13 +614,10 @@ libusb_claim_interface(struct libusb20_d 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402040859.s148x3ZU063035>