]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/api.c
Factor out common hw_init() driver code.
[libsigrok.git] / hardware / agilent-dmm / api.c
index 8c792a35c5d10bdd903d18cbe317466908aa92f5..26213938af2bb09e36d662c65a467f00c8816675 100644 (file)
@@ -91,17 +91,7 @@ static int clear_instances(void)
 
 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)