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;
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);
- if (sdi)
- sr_dev_inst_free(sdi);
+ sr_dev_inst_free(sdi);
return NULL;
}
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,
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.
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;