SR_MHZ(200),
};
-static int dev_close(struct sr_dev_inst *sdi);
-
SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate)
{
int i;
if (ret != SR_OK)
return ret;
- sdi->status = SR_ST_ACTIVE;
-
ret = libusb_set_configuration(usb->devhdl, USB_CONFIGURATION);
if (ret < 0) {
sr_err("Unable to set USB configuration %d: %s.",
usb = sdi->conn;
if (!usb->devhdl)
- return SR_ERR;
+ return SR_ERR_BUG;
sr_info("Closing device on %d.%d (logical) / %s (physical) interface %d.",
usb->bus, usb->address, sdi->connection_id, USB_INTERFACE);
libusb_reset_device(usb->devhdl);
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;
switch (key) {