X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flecroy-xstream%2Fapi.c;h=e00154b9bef88bc87d1d9066a4a5b31fa6daf65b;hb=8bf18daabbf3cb0fec6c178b4bc7f6283a314e45;hp=2d4acf97485f6a16533691b90a76945c2355e2ab;hpb=d2f7c417fdd96a13d8fd86350d2fc13db16f626c;p=libsigrok.git diff --git a/src/hardware/lecroy-xstream/api.c b/src/hardware/lecroy-xstream/api.c index 2d4acf97..e00154b9 100644 --- a/src/hardware/lecroy-xstream/api.c +++ b/src/hardware/lecroy-xstream/api.c @@ -124,38 +124,27 @@ static void clear_helper(void *priv) lecroy_xstream_state_free(devc->model_state); g_free(devc->analog_groups); - - g_free(devc); } 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 dev_open(struct sr_dev_inst *sdi) { - if (sdi->status != SR_ST_ACTIVE && sr_scpi_open(sdi->conn) != SR_OK) + if (sr_scpi_open(sdi->conn) != SR_OK) return SR_ERR; if (lecroy_xstream_state_get(sdi) != SR_OK) return SR_ERR; - sdi->status = SR_ST_ACTIVE; - return SR_OK; } static int dev_close(struct sr_dev_inst *sdi) { - if (sdi->status == SR_ST_INACTIVE) - return SR_OK; - - sr_scpi_close(sdi->conn); - - sdi->status = SR_ST_INACTIVE; - - return SR_OK; + return sr_scpi_close(sdi->conn); } static int config_get(uint32_t key, GVariant **data, @@ -553,9 +542,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) int ret; struct sr_scpi_dev_inst *scpi; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; scpi = sdi->conn; /* Preset empty results. */