g_free(vendor);
g_free(model);
g_free(serial_num);
+ ftdi_free(devc->ftdic);
err_free_data_buf:
g_free(devc->data_buf);
g_free(devc);
curdev = curdev->next;
}
+ ftdi_list_free(&devlist);
+ ftdi_free(ftdic);
+
return devices;
err_free_ftdic:
return SR_OK;
}
-static int cleanup(const struct sr_dev_driver *di)
-{
- dev_clear(di);
-
- /* TODO: Free other driver resources, if any. */
-
- return SR_OK;
-}
-
static int config_get(uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{
return ret;
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
- (void)cb_data;
-
devc = sdi->priv;
if (sdi->status != SR_ST_ACTIVE)
ftdi_set_bitmode(devc->ftdic, 0, BITMODE_BITBANG);
- devc->cb_data = cb_data;
-
/* Properly reset internal variables before every new acquisition. */
devc->samples_sent = 0;
devc->bytes_received = 0;
return SR_OK;
}
-static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- (void)cb_data;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
.longname = "FTDI LA",
.api_version = 1,
.init = init,
- .cleanup = cleanup,
+ .cleanup = std_cleanup,
.scan = scan,
.dev_list = dev_list,
.dev_clear = dev_clear,