]> sigrok.org Git - libsigrok.git/blobdiff - hardware/fx2lafw/fx2lafw.c
Don't automatically clear known instances from USB drivers on scan
[libsigrok.git] / hardware / fx2lafw / fx2lafw.c
index f74c5a510b0f1fe4d6035ba37e3708c746820cd7..9647c4b0e903cf92b439d73f1f7175fd1b1e450e 100644 (file)
@@ -371,9 +371,6 @@ static GSList *hw_scan(GSList *options)
 
        drvc = di->priv;
 
-       /* This scan always invalidates any previous scans. */
-       clear_instances();
-
        conn = NULL;
        for (l = options; l; l = l->next) {
                src = l->data;
@@ -617,6 +614,9 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
        int ret;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR;
+
        devc = sdi->priv;
 
        if (id == SR_CONF_SAMPLERATE) {
@@ -948,6 +948,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        unsigned char *buf;
        size_t size;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR_DEV_CLOSED;
+
        drvc = di->priv;
        devc = sdi->priv;
        usb = sdi->conn;