- /* Properly close and free all devices. */
- for (l = drvc->instances; l; l = l->next) {
- if (!(sdi = l->data)) {
- /* Log error, but continue cleaning up the rest. */
- sr_err("%s: sdi was NULL, continuing", __func__);
- ret = SR_ERR_BUG;
- continue;
- }
- if (!(devc = sdi->priv)) {
- /* Log error, but continue cleaning up the rest. */
- sr_err("%s: sdi->priv was NULL, continuing", __func__);
- ret = SR_ERR_BUG;
- continue;
- }
- hw_dev_close(sdi);
- sr_serial_dev_inst_free(devc->serial);
- sr_dev_inst_free(sdi);
- }
- g_slist_free(drvc->instances);
- drvc->instances = NULL;
-
- return ret;
-}
-
-static int hw_info_get(int info_id, const void **data,
- const struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
-
- switch (info_id) {
- case SR_DI_HWCAPS:
- *data = hwcaps;
- break;
- case SR_DI_SAMPLERATES:
- *data = &samplerates;
- break;
- case SR_DI_TRIGGER_TYPES:
- *data = (char *)TRIGGER_TYPES;
- break;
- case SR_DI_CUR_SAMPLERATE: