]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/testo/api.c
sr_dev_close(): Set status to SR_ST_INACTIVE.
[libsigrok.git] / src / hardware / testo / api.c
index d04cce6f3ca8b87a8b6289d664e1466ece80d600..548cdb3d8107865b32b5184cb7dead8d6294d369 100644 (file)
@@ -162,7 +162,6 @@ static int dev_open(struct sr_dev_inst *sdi)
                sr_err("Failed to claim interface: %s.", libusb_error_name(ret));
                return SR_ERR;
        }
-       sdi->status = SR_ST_ACTIVE;
 
        return SR_OK;
 }
@@ -172,14 +171,13 @@ static int dev_close(struct sr_dev_inst *sdi)
        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;
 }
@@ -218,9 +216,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
 
        (void)cg;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        return sr_sw_limits_config_set(&devc->sw_limits, key, data);
 }
 
@@ -372,10 +367,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        unsigned char *buf;
 
        drvc = di->context;
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
-
        devc = sdi->priv;
        usb = sdi->conn;
        devc->reply_size = 0;