nexus-osciprime: Use std_dev_clear().
This commit is contained in:
parent
c9d622a420
commit
658636f1c9
|
@ -102,37 +102,12 @@ static const uint64_t vdivs[][2] = {
|
||||||
{ 10, 1 },
|
{ 10, 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info;
|
SR_PRIV struct sr_dev_driver nexus_osciprime_driver_info;
|
||||||
static struct sr_dev_driver *di = &nexus_osciprime_driver_info;
|
static struct sr_dev_driver *di = &nexus_osciprime_driver_info;
|
||||||
static int dev_close(struct sr_dev_inst *sdi);
|
|
||||||
|
|
||||||
/* Properly close and free all devices. */
|
|
||||||
static int clear_instances(void)
|
static int clear_instances(void)
|
||||||
{
|
{
|
||||||
struct sr_dev_inst *sdi;
|
return std_dev_clear(di, NULL);
|
||||||
struct drv_context *drvc;
|
|
||||||
struct dev_context *devc;
|
|
||||||
GSList *l;
|
|
||||||
|
|
||||||
if (!(drvc = di->priv))
|
|
||||||
return SR_OK;
|
|
||||||
|
|
||||||
for (l = drvc->instances; l; l = l->next) {
|
|
||||||
if (!(sdi = l->data))
|
|
||||||
continue;
|
|
||||||
if (!(devc = sdi->priv))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
dev_close(sdi);
|
|
||||||
sr_usb_dev_inst_free(devc->usb);
|
|
||||||
sr_dev_inst_free(sdi);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_slist_free(drvc->instances);
|
|
||||||
drvc->instances = NULL;
|
|
||||||
|
|
||||||
return SR_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init(struct sr_context *sr_ctx)
|
static int init(struct sr_context *sr_ctx)
|
||||||
|
@ -234,11 +209,7 @@ static int dev_close(struct sr_dev_inst *sdi)
|
||||||
|
|
||||||
static int cleanup(void)
|
static int cleanup(void)
|
||||||
{
|
{
|
||||||
clear_instances();
|
return clear_instances();
|
||||||
|
|
||||||
/* TODO */
|
|
||||||
|
|
||||||
return SR_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
|
static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
|
||||||
|
|
Loading…
Reference in New Issue