X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Frohde-schwarz-sme-0x%2Fapi.c;h=ff04242cab252dd58f9105d428d45d70669a5304;hb=093e1cba6b7bf14cfb77fa36f59b0c16e6fca7cc;hp=6b84c64a6f72c7008256300b07f64d20a51593d6;hpb=0d9841ddd6ef917258d95a50d753d80a23fabb90;p=libsigrok.git diff --git a/src/hardware/rohde-schwarz-sme-0x/api.c b/src/hardware/rohde-schwarz-sme-0x/api.c index 6b84c64a..ff04242c 100644 --- a/src/hardware/rohde-schwarz-sme-0x/api.c +++ b/src/hardware/rohde-schwarz-sme-0x/api.c @@ -144,12 +144,8 @@ static struct sr_dev_inst *rs_probe_serial_device(struct sr_scpi_dev_inst *scpi) 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; } @@ -176,9 +172,6 @@ static int dev_open(struct sr_dev_inst *sdi) 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; @@ -219,9 +212,6 @@ static int config_set(uint32_t key, GVariant *data, 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); @@ -269,8 +259,7 @@ static int config_list(uint32_t key, GVariant **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; }