]> 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 492e5397af5a135e9b5bf1f4a8e0e02f38c92ba8..9647c4b0e903cf92b439d73f1f7175fd1b1e450e 100644 (file)
@@ -369,13 +369,8 @@ static GSList *hw_scan(GSList *options)
        int devcnt, num_logic_probes, ret, i, j;
        const char *conn;
 
-       (void)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;
@@ -619,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) {
@@ -950,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;