X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Frohde-schwarz-sme-0x%2Fapi.c;h=ff04242cab252dd58f9105d428d45d70669a5304;hb=093e1cba6b7bf14cfb77fa36f59b0c16e6fca7cc;hp=9d8548ed5cff1426aac67f50b4dff4f07612d9b5;hpb=4bf93988023b2428129c8145ef9ea7121400f195;p=libsigrok.git diff --git a/src/hardware/rohde-schwarz-sme-0x/api.c b/src/hardware/rohde-schwarz-sme-0x/api.c index 9d8548ed..ff04242c 100644 --- a/src/hardware/rohde-schwarz-sme-0x/api.c +++ b/src/hardware/rohde-schwarz-sme-0x/api.c @@ -144,8 +144,7 @@ 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); + sr_scpi_hw_info_free(hw_info); sr_dev_inst_free(sdi); g_free(devc); return NULL; @@ -173,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; @@ -216,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); @@ -266,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; }