X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fhardware%2Fmotech-lps-30x%2Fapi.c;h=fe396199ee98a13e5b822c4f96a04b5ac9395a7d;hb=6e43c3d5318a8ff320bf6539a9efe7f0b8497e2f;hp=68e4139373073f8ef917081eb4270c2591566523;hpb=4bf93988023b2428129c8145ef9ea7121400f195;p=libsigrok.git diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c index 68e41393..fe396199 100644 --- a/src/hardware/motech-lps-30x/api.c +++ b/src/hardware/motech-lps-30x/api.c @@ -386,8 +386,6 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o devc = NULL; conn = serialcomm = NULL; - sr_spew("scan() called!"); - /* Process and check options. */ if (sr_serial_extract_options(options, &conn, &serialcomm) != SR_OK) return NULL; @@ -483,10 +481,9 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o exit_err: sr_info("%s: Error!", __func__); - if (serial) { + if (serial) serial_close(serial); - sr_serial_dev_inst_free(serial); - } + sr_serial_dev_inst_free(serial); g_free(devc); sr_dev_inst_free(sdi); @@ -510,7 +507,7 @@ static void dev_clear_private(struct dev_context *devc) static int dev_clear_lps301(const struct sr_dev_driver *di) { - return std_dev_clear(di, (std_dev_clear_callback)dev_clear_private); + return std_dev_clear_with_callback(di, (std_dev_clear_callback)dev_clear_private); } static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, @@ -577,9 +574,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd int idx; gboolean found; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; /* Cannot change settings while acquisition active, would cause a mess with commands. @@ -765,9 +759,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) struct dev_context *devc; struct sr_serial_dev_inst *serial; - if (sdi->status != SR_ST_ACTIVE) - return SR_ERR_DEV_CLOSED; - devc = sdi->priv; devc->acq_running = TRUE;