g_free(devc->trigger_source);
g_free(devc->trigger_slope);
g_free(devc->analog_groups);
- g_free(devc);
}
static int dev_clear(const struct sr_dev_driver *di)
{
- return std_dev_clear(di, clear_helper);
+ return std_dev_clear_with_callback(di, clear_helper);
}
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
return SR_ERR;
}
- sdi->status = SR_ST_ACTIVE;
-
return SR_OK;
}
scpi = sdi->conn;
devc = sdi->priv;
+ if (!scpi)
+ return SR_ERR_BUG;
+
if (devc->model->series->protocol == PROTOCOL_V2)
rigol_ds_config_set(sdi, ":KEY:LOCK DISABLE");
- if (scpi) {
- if (sr_scpi_close(scpi) < 0)
- return SR_ERR;
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
+ return sr_scpi_close(scpi);
}
static int analog_frame_size(const struct sr_dev_inst *sdi)