X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/6c235d59caa48963278183c19762c80dbabdec2e..6234190be3437eb8e6ce225f934e2ad97ce46c6a:/xpcu.c diff --git a/xpcu.c b/xpcu.c index 28770fe..17ab7cb 100644 --- a/xpcu.c +++ b/xpcu.c @@ -166,7 +166,7 @@ int xpcu_deviceinfo(struct xpcu_s *xpcu, unsigned char *buf) { return len; } -int xpcu_claim(struct xpcu_s *xpcu, int claim) { +static int xpcu_claim(struct xpcu_s *xpcu, int claim) { int ret = 0; static int claimed = 0; @@ -247,3 +247,14 @@ struct xpcu_s *xpcu_open(void) { return &xpcu; } + +void xpcu_close(struct xpcu_s *xpcu) { + if (xpcu->handle) { + xpcu_claim(xpcu, XPCU_RELEASE); + usb_close(xpcu->handle); + } + + xpcu->handle = NULL; + xpcu->interface = -1; + xpcu->alternate = -1; +}