beaglelogic: Use std_dev_clear() instead of open-coding it

The beaglelogic has an open-coded version of std_dev_clear(), replace it
with std_dev_clear().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2016-04-29 14:08:42 +02:00
parent a64fec2b8e
commit 74c6d807ef
1 changed files with 1 additions and 19 deletions

View File

@ -202,25 +202,7 @@ static int dev_close(struct sr_dev_inst *sdi)
static int cleanup(const struct sr_dev_driver *di)
{
struct drv_context *drvc;
struct sr_dev_inst *sdi;
GSList *l;
/* unused driver */
if (!(drvc = di->context))
return SR_OK;
/* Clean up the instances */
for (l = drvc->instances; l; l = l->next) {
sdi = l->data;
di->dev_close(sdi);
g_free(sdi->priv);
sr_dev_inst_free(sdi);
}
g_slist_free(drvc->instances);
drvc->instances = NULL;
return SR_OK;
return std_dev_clear(di, NULL);
}
static int config_get(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,