-/* Properly close and free all devices. */
-static int clear_instances(void)
-{
- struct sr_dev_inst *sdi;
- struct drv_context *drvc;
- struct dev_context *devc;
- GSList *l;
-
- if (!(drvc = di->priv))
- return SR_OK;
-
- drvc = di->priv;
- for (l = drvc->instances; l; l = l->next) {
- if (!(sdi = l->data))
- continue;
- if (!(devc = sdi->priv))
- continue;
- sr_serial_dev_inst_free(devc->serial);
- sr_dev_inst_free(sdi);
- }
- g_slist_free(drvc->instances);
- drvc->instances = NULL;
-
- return SR_OK;
-}
-
-static int hw_init(void)
-{
- struct drv_context *drvc;
-
- if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
- sr_err("fluke-dmm: driver context malloc failed.");
- return SR_ERR;
- }
-
- di->priv = drvc;
-
- return SR_OK;
-}
-
-static int serial_readline(int fd, char **buf, int *buflen, uint64_t timeout_ms)