sr_err("Failed to claim interface: %s.", libusb_error_name(ret));
return SR_ERR;
}
- sdi->status = SR_ST_ACTIVE;
return SR_OK;
}
struct sr_usb_dev_inst *usb;
usb = sdi->conn;
+
if (!usb->devhdl)
- /* Nothing to do. */
- return SR_OK;
+ return SR_ERR_BUG;
libusb_release_interface(usb->devhdl, 0);
libusb_close(usb->devhdl);
usb->devhdl = NULL;
- sdi->status = SR_ST_INACTIVE;
return SR_OK;
}