X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbeaglelogic%2Fapi.c;h=0d022f2b336967e0aea956071d21ca92589c55eb;hb=093e1cba6b7bf14cfb77fa36f59b0c16e6fca7cc;hp=34b09f211fb26f2b54e464a7f973c2ce0a51ee3e;hpb=bee2b0168c087676c1b365861d8c2d4714afa9b9;p=libsigrok.git diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index 34b09f21..0d022f2b 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -166,12 +166,12 @@ static int dev_close(struct sr_dev_inst *sdi) { struct dev_context *devc = sdi->priv; - if (sdi->status == SR_ST_ACTIVE) { - /* Close the memory mapping and the file */ - beaglelogic_munmap(devc); - beaglelogic_close(devc); - } + /* Close the memory mapping and the file */ + beaglelogic_munmap(devc); + beaglelogic_close(devc); + sdi->status = SR_ST_INACTIVE; + return SR_OK; } @@ -210,9 +210,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; - switch (key) { case SR_CONF_SAMPLERATE: devc->cur_samplerate = g_variant_get_uint64(data); @@ -294,9 +291,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) struct dev_context *devc = sdi->priv; struct sr_trigger *trigger; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - /* Clear capture state */ devc->bytes_read = 0; devc->offset = 0; @@ -332,9 +326,6 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) { struct dev_context *devc = sdi->priv; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - /* Execute a stop on BeagleLogic */ beaglelogic_stop(devc);