SR_HZ(100),
};
-SR_PRIV struct sr_dev_driver link_mso19_driver_info;
-
/* TODO: Use sr_dev_inst to store connection handle & use std_dev_clear(). */
static int dev_clear(const struct sr_dev_driver *di)
{
+ struct drv_context *drvc = di->context;
GSList *l;
struct sr_dev_inst *sdi;
- struct drv_context *drvc;
struct dev_context *devc;
int ret = SR_OK;
- if (!(drvc = di->context))
- return SR_OK;
-
/* Properly close and free all devices. */
for (l = drvc->instances; l; l = l->next) {
if (!(sdi = l->data)) {
return ret;
}
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
- return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
int i;
(void)cg;
+ if (!sdi)
+ return SR_ERR_ARG;
+
+ devc = sdi->priv;
+
switch (key) {
case SR_CONF_SAMPLERATE:
- if (sdi) {
- devc = sdi->priv;
- *data = g_variant_new_uint64(devc->cur_rate);
- } else
- return SR_ERR;
+ *data = g_variant_new_uint64(devc->cur_rate);
break;
default:
return SR_ERR_NA;
double pos;
(void)cg;
+
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
return SR_OK;
}
-SR_PRIV struct sr_dev_driver link_mso19_driver_info = {
+static struct sr_dev_driver link_mso19_driver_info = {
.name = "link-mso19",
.longname = "Link Instruments MSO-19",
.api_version = 1,
- .init = init,
+ .init = std_init,
.cleanup = std_cleanup,
.scan = scan,
.dev_list = std_dev_list,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
};
+SR_REGISTER_DEV_DRIVER(link_mso19_driver_info);