sdi->model = model ? g_strdup(model) : NULL;
sdi->version = version ? g_strdup(version) : NULL;
sdi->probes = NULL;
- sdi->probe_groups = NULL;
+ sdi->channel_groups = NULL;
sdi->conn = NULL;
sdi->priv = NULL;
}
g_slist_free(sdi->probes);
- if (sdi->probe_groups)
- g_slist_free(sdi->probe_groups);
+ if (sdi->channel_groups)
+ g_slist_free(sdi->channel_groups);
g_free(sdi->vendor);
g_free(sdi->model);
}
/**
- * Clear all devices/instances of the specified driver.
+ * Clear the list of device instances a driver knows about.
*
- * @param driver The driver to use. Must not be NULL.
+ * @param driver The driver to use. This must be a pointer to one of
+ * the entries returned by sr_driver_list(). Must not be NULL.
*
- * @return SR_OK upon success, a negative error code upon errors.
+ * @retval SR_OK Success
+ * @retval SR_ERR_ARG Invalid driver
*
* @since 0.2.0
*/
SR_API int sr_dev_clear(const struct sr_dev_driver *driver)
{
- if (driver && driver->dev_clear)
- return driver->dev_clear();
+ int ret;
+
+ if (!driver) {
+ sr_err("Invalid driver.");
+ return SR_ERR_ARG;
+ }
+
+ if (driver->dev_clear)
+ ret = driver->dev_clear();
else
- return SR_OK;
+ ret = std_dev_clear(driver, NULL);
+
+ return ret;
}
/**