]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hameg-hmo/api.c
sr_dev_open(): Factor out SR_ST_ACTIVE check.
[libsigrok.git] / src / hardware / hameg-hmo / api.c
index 8a4212af096d7610209f7419de1a36135405dee2..20b5779c1968badbbfb29e4cca0902aabdb8946a 100644 (file)
@@ -131,7 +131,7 @@ static int dev_clear(const struct sr_dev_driver *di)
 
 static int dev_open(struct sr_dev_inst *sdi)
 {
-       if (sdi->status != SR_ST_ACTIVE && sr_scpi_open(sdi->conn) != SR_OK)
+       if (sr_scpi_open(sdi->conn) != SR_OK)
                return SR_ERR;
 
        if (hmo_scope_state_get(sdi) != SR_OK)
@@ -144,9 +144,6 @@ static int dev_open(struct sr_dev_inst *sdi)
 
 static int dev_close(struct sr_dev_inst *sdi)
 {
-       if (sdi->status == SR_ST_INACTIVE)
-               return SR_OK;
-
        sr_scpi_close(sdi->conn);
 
        sdi->status = SR_ST_INACTIVE;
@@ -727,9 +724,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        struct sr_scpi_dev_inst *scpi;
        int ret;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        scpi = sdi->conn;
        devc = sdi->priv;