]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/api.c
sr_dev_open(): Set status to SR_ST_ACTIVE upon success.
[libsigrok.git] / src / hardware / scpi-pps / api.c
index bdf4bffe55233c0fe0e582517e43c3ad54d7170c..52b70d3e0adf5a6f582b23004e3ed312b20bf986 100644 (file)
@@ -251,15 +251,10 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_scpi_dev_inst *scpi;
        GVariant *beeper;
 
-       if (sdi->status != SR_ST_INACTIVE)
-               return SR_ERR;
-
        scpi = sdi->conn;
        if (sr_scpi_open(scpi) < 0)
                return SR_ERR;
 
-       sdi->status = SR_ST_ACTIVE;
-
        devc = sdi->priv;
        scpi_cmd(sdi, devc->device->commands, SCPI_CMD_REMOTE);
        devc->beeper_was_set = FALSE;
@@ -280,9 +275,6 @@ static int dev_close(struct sr_dev_inst *sdi)
        struct sr_scpi_dev_inst *scpi;
        struct dev_context *devc;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        devc = sdi->priv;
        scpi = sdi->conn;
        if (scpi) {
@@ -450,9 +442,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (!sdi)
                return SR_ERR_ARG;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        if (cg)
                /* Channel group specified. */
                select_channel(sdi, cg->channels->data);