#include "libsigrok-internal.h"
#include "driver.h"
-static GSList *dev_insts = NULL;
+SR_PRIV struct sr_dev_driver chronovu_la8_driver_info;
+static struct sr_dev_driver *cdi = &chronovu_la8_driver_info;
/*
* The ChronoVu LA8 can have multiple PIDs. Older versions shipped with
sdi->priv = ctx;
- dev_insts = g_slist_append(dev_insts, sdi);
+ cdi->instances = g_slist_append(cdi->instances, sdi);
sr_spew("la8: Device init successful.");
struct sr_dev_inst *sdi;
struct context *ctx;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return SR_ERR_BUG;
}
struct sr_dev_inst *sdi;
struct context *ctx;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return SR_ERR_BUG;
}
int ret = SR_OK;
/* Properly close all devices. */
- for (l = dev_insts; l; l = l->next) {
+ for (l = cdi->instances; l; l = l->next) {
if (!(sdi = l->data)) {
/* Log error, but continue cleaning up the rest. */
sr_err("la8: %s: sdi was NULL, continuing", __func__);
}
sr_dev_inst_free(sdi); /* Returns void. */
}
- g_slist_free(dev_insts); /* Returns void. */
- dev_insts = NULL;
+ g_slist_free(cdi->instances); /* Returns void. */
+ cdi->instances = NULL;
return ret;
}
struct context *ctx;
const void *info;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return NULL;
}
{
struct sr_dev_inst *sdi;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL, device not found", __func__);
return SR_ST_NOT_FOUND;
}
struct sr_dev_inst *sdi;
struct context *ctx;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return SR_ERR_BUG;
}
uint8_t buf[4];
int bytes_written;
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return SR_ERR_BUG;
}
sr_dbg("la8: Stopping acquisition.");
- if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
+ if (!(sdi = sr_dev_inst_get(cdi->instances, dev_index))) {
sr_err("la8: %s: sdi was NULL", __func__);
return SR_ERR_BUG;
}
.dev_config_set = hw_dev_config_set,
.dev_acquisition_start = hw_dev_acquisition_start,
.dev_acquisition_stop = hw_dev_acquisition_stop,
+ .instances = NULL,
};