static int hw_init(struct sr_context *sr_ctx)
{
- struct drv_context *drvc;
-
- if (!(drvc = g_try_malloc0(sizeof(struct drv_context)))) {
- sr_err("Driver context malloc failed.");
- return SR_ERR_MALLOC;
- }
-
- drvc->sr_ctx = sr_ctx;
- di->priv = drvc;
-
- return SR_OK;
+ return std_hw_init(sr_ctx, di, DRIVER_LOG_DOMAIN);
}
static GSList *hw_scan(GSList *options)
(void)options;
- devices = NULL;
drvc = di->priv;
drvc->instances = NULL;
+ devices = NULL;
+
dir = g_dir_open("/sys/class/usb/", 0, NULL);
if (dir == NULL)