return sdi;
fail:
- if (hw_info)
- sr_scpi_hw_info_free(hw_info);
-
- if (sdi)
- sr_dev_inst_free(sdi);
-
+ sr_scpi_hw_info_free(hw_info);
+ sr_dev_inst_free(sdi);
g_free(devc);
return NULL;
}
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;
if (!sdi)
return SR_ERR_ARG;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
switch (key) {
case SR_CONF_OUTPUT_FREQUENCY:
value_f = g_variant_get_double(data);
static int dev_acquisition_start(const struct sr_dev_inst *sdi)
{
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
+ (void)sdi;
return SR_OK;
}