X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=4440be67f52695fd4613dac506381a93c253efae;hb=53279f13e4694fcf2aba314baade418941b0bc3e;hp=33d965e58c9abf36d3e589994f43cc2201f35f24;hpb=f670835f1fbc03525e995d6970a5495976ab7c1a;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index 33d965e5..4440be67 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -201,7 +201,7 @@ static void clear_helper(void *priv) static int dev_clear(const struct sr_dev_driver *di) { - return std_dev_clear(di, clear_helper); + return std_dev_clear_with_callback(di, clear_helper); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, @@ -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,16 @@ static int dev_open(struct sr_dev_inst *sdi) devc = sdi->priv; - if (p_ols_open(devc) != SR_OK) { - return SR_ERR; - } else { - sdi->status = SR_ST_ACTIVE; - return SR_OK; - } + return p_ols_open(devc); } 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)