sr_err("Failed to claim interface: %s.", libusb_error_name(ret));
return SR_ERR;
}
- sdi->status = SR_ST_ACTIVE;
- return ret;
+ return SR_OK;
}
static int dev_close(struct sr_dev_inst *sdi)
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
- return SR_OK;
+ return SR_ERR_BUG;
/* This allows a frontend to configure the device without ever
* doing an acquisition step. */
libusb_release_interface(usb->devhdl, USB_INTERFACE);
libusb_close(usb->devhdl);
usb->devhdl = NULL;
- sdi->status = SR_ST_INACTIVE;
return SR_OK;
}
(void)cg;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
ret = SR_OK;
switch (key) {
int req_len, buf_len, len, ret;
unsigned char buf[9];
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
drvc = di->context;
devc = sdi->priv;
usb = sdi->conn;