]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/ikalogic-scanaplus/api.c
sr_dev_close(): Set status to SR_ST_INACTIVE.
[libsigrok.git] / src / hardware / ikalogic-scanaplus / api.c
index 2105bce130ed937ef4a9da75070a0c2c7f3b750f..79585f060dfc86f9d71209cd27f2567611bd7f82 100644 (file)
@@ -207,33 +207,21 @@ static int dev_open(struct sr_dev_inst *sdi)
        sr_dbg("Received ScanaPLUS device ID successfully: %02x %02x %02x.",
               devc->devid[0], devc->devid[1], devc->devid[2]);
 
-       sdi->status = SR_ST_ACTIVE;
-
        return SR_OK;
 
 err_dev_open_close_ftdic:
        scanaplus_close(devc);
+
        return SR_ERR;
 }
 
 static int dev_close(struct sr_dev_inst *sdi)
 {
-       int ret;
        struct dev_context *devc;
 
-       ret = SR_OK;
        devc = sdi->priv;
 
-       if (sdi->status == SR_ST_ACTIVE) {
-               sr_dbg("Status ACTIVE, closing device.");
-               ret = scanaplus_close(devc);
-       } else {
-               sr_spew("Status not ACTIVE, nothing to do.");
-       }
-
-       sdi->status = SR_ST_INACTIVE;
-
-       return ret;
+       return scanaplus_close(devc);
 }
 
 static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
@@ -261,9 +249,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;
-
        devc = sdi->priv;
 
        switch (key) {