/* 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;
return devices;
}
-static GSList *dev_list(const struct sr_dev_driver *di)
-{
- return ((struct drv_context *)(di->context))->instances;
-}
-
static int dev_open(struct sr_dev_inst *sdi)
{
int ret;
return SR_OK;
}
-static int cleanup(const struct sr_dev_driver *di)
-{
- return dev_clear();
-}
-
static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
double pos;
(void)cg;
+
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
.name = "link-mso19",
.longname = "Link Instruments MSO-19",
.api_version = 1,
- .init = init,
- .cleanup = cleanup,
+ .init = std_init,
+ .cleanup = std_cleanup,
.scan = scan,
- .dev_list = dev_list,
+ .dev_list = std_dev_list,
.dev_clear = dev_clear,
.config_get = config_get,
.config_set = config_set,