]> sigrok.org Git - libsigrok.git/blobdiff - hardware/zeroplus-logic-cube/zeroplus.c
device: Cosmetics.
[libsigrok.git] / hardware / zeroplus-logic-cube / zeroplus.c
index f8cf81f8bc73c2d6ed4d677a403cb30c8340d185..00200b6954762395cd99835f1e00b6caec1e95d1 100644 (file)
@@ -126,10 +126,10 @@ static const uint64_t supported_samplerates[] = {
 };
 
 static const struct sr_samplerates samplerates = {
-       0,
-       0,
-       0,
-       supported_samplerates,
+       .low  = 0,
+       .high = 0,
+       .step = 0,
+       .list = supported_samplerates,
 };
 
 /* Private, per-device-instance driver context. */
@@ -289,17 +289,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, "zeroplus: ");
 }
 
 static GSList *hw_scan(GSList *options)
@@ -317,6 +307,7 @@ static GSList *hw_scan(GSList *options)
        (void)options;
 
        drvc = di->priv;
+
        devices = NULL;
 
        clear_instances();