X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=5995cdf87f69cb21ccd1f81a56883f64f15bf2f0;hb=6402c379161ec138e451901c411817a55846a75b;hp=bf7436065254ddd6564e4279373b120d33723a52;hpb=d2f7c417fdd96a13d8fd86350d2fc13db16f626c;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index bf743606..5995cdf8 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -257,9 +257,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) { @@ -414,32 +411,23 @@ static int dev_open(struct sr_dev_inst *sdi) devc = sdi->priv; - if (p_ols_open(devc) != SR_OK) { + if (p_ols_open(devc) != SR_OK) return SR_ERR; - } else { - sdi->status = SR_ST_ACTIVE; - return SR_OK; - } + + sdi->status = SR_ST_ACTIVE; + + return SR_OK; } 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 = p_ols_close(devc); - } else { - sr_spew("Status not ACTIVE, nothing to do."); - } - sdi->status = SR_ST_INACTIVE; - return ret; + return p_ols_close(devc); } static int set_trigger(const struct sr_dev_inst *sdi, int stage) @@ -523,9 +511,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) int num_pols_changrp, samplespercount; int ret, i; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; pols_channel_mask(sdi);