]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hung-chang-dso-2100/api.c
sr_dev_close(): Set status to SR_ST_INACTIVE.
[libsigrok.git] / src / hardware / hung-chang-dso-2100 / api.c
index 0ed7995962f4bb8aa87f6288db08458ec43ab3b1..0aa012a1a3b54e90d1ed3a15137aa565e8eefac0 100644 (file)
@@ -246,9 +246,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct dev_context *devc = sdi->priv;
        int i;
 
-       if (sdi->status != SR_ST_INACTIVE)
-               goto fail1;
-
        if (ieee1284_open(sdi->conn, 0, &i) != E1284_OK)
                goto fail1;
 
@@ -265,8 +262,6 @@ static int dev_open(struct sr_dev_inst *sdi)
        if (!devc->samples)
                goto fail3;
 
-       sdi->status = SR_ST_ACTIVE;
-
        return SR_OK;
 
 fail3:
@@ -282,14 +277,10 @@ static int dev_close(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_OK;
-
        g_free(devc->samples);
        hung_chang_dso_2100_reset_port(sdi->conn);
        ieee1284_release(sdi->conn);
        ieee1284_close(sdi->conn);
-       sdi->status = SR_ST_INACTIVE;
 
        return SR_OK;
 }
@@ -434,9 +425,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        if (cg) /* sr_config_set will validate cg using config_list */
                ch = ((struct sr_channel *)cg->channels->data)->index;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        ret = SR_OK;
        switch (key) {
        case SR_CONF_LIMIT_FRAMES:
@@ -549,9 +537,6 @@ static int config_commit(const struct sr_dev_inst *sdi)
        uint8_t state = hung_chang_dso_2100_read_mbox(sdi->conn, 0.02);
        int ret;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        switch (state) {
        case 0x03:
        case 0x14:
@@ -664,9 +649,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        struct dev_context *devc = sdi->priv;
        int ret;
 
-       if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR_DEV_CLOSED;
-
        if (devc->channel) {
                static const float res_array[] = {0.5, 1, 2, 5};
                static const uint8_t relays[] = {100, 10, 10, 1};