]> sigrok.org Git - libsigrok.git/commitdiff
brymen-dmm: Use std_hw_init().
authorUwe Hermann <redacted>
Sat, 2 Feb 2013 10:19:03 +0000 (11:19 +0100)
committerUwe Hermann <redacted>
Sat, 2 Feb 2013 10:19:27 +0000 (11:19 +0100)
hardware/brymen-dmm/api.c

index 697959f40d46570ef38722eb6d36517cdc255c57..8ff9c2e9405654c685112b77cb5ba414be6fd75e 100644 (file)
@@ -44,17 +44,7 @@ static struct sr_dev_driver *di = &brymen_dmm_driver_info;
 
 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 void free_instance(void *inst)