exit_err:
sr_info("scan_2x_bd232(): Error!");
- if (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;
}
{
struct dev_context *devc;
- std_serial_dev_close(sdi);
+ devc = sdi->priv;
- sdi->status = SR_ST_INACTIVE;
- if ((devc = sdi->priv))
- devc->model = METRAHIT_NONE;
+ devc->model = METRAHIT_NONE;
- return SR_OK;
+ return std_serial_dev_close(sdi);
}
static int config_get(uint32_t key, GVariant **data, 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->settings_ok = FALSE;
devc->buflen = 0;
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->settings_ok = FALSE;
devc->buflen = 0;