+ struct drv_context *drvc;
+ struct dev_context *devc;
+ int ret;
+
+ drvc = di->priv;
+ ret = SR_OK;
+ for (l = drvc->instances; l; l = l->next) {
+ if (!(sdi = l->data)) {
+ /* Log error, but continue cleaning up the rest. */
+ sr_err("sdi was NULL, continuing.");
+ ret = SR_ERR_BUG;
+ continue;
+ }
+ if (!(devc = sdi->priv)) {
+ /* Log error, but continue cleaning up the rest. */
+ sr_err("sdi->priv was NULL, continuing.");
+ ret = SR_ERR_BUG;
+ continue;
+ }
+ hw_dev_close(sdi);
+ sr_usb_dev_inst_free(devc->usb);
+ sdi = l->data;
+ sr_dev_inst_free(sdi);
+ }
+
+ g_slist_free(drvc->instances);
+ drvc->instances = NULL;
+
+ return ret;
+}
+
+static int hw_init(struct sr_context *sr_ctx)
+{
+ return std_hw_init(sr_ctx, di, DRIVER_LOG_DOMAIN);
+}
+
+static GSList *hw_scan(GSList *options)
+{
+ GSList *devices;