]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/gmc-mh-1x-2x/api.c
Eliminate sr_dev_inst_new().
[libsigrok.git] / src / hardware / gmc-mh-1x-2x / api.c
index 464fe5029bec61c76f8912cf979dc12b6f24bfe7..32a471afe4e3cdf10a2acce95ab77ec45b41678f 100644 (file)
@@ -223,7 +223,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
 
        if (model != METRAHIT_NONE) {
                sr_spew("%s %s detected!", VENDOR_GMC, gmc_model_str(model));
-               sdi = sr_dev_inst_new();
+               sdi = g_malloc0(sizeof(struct sr_dev_inst));
                sdi->status = SR_ST_INACTIVE;
                sdi->vendor = g_strdup(VENDOR_GMC);
                sdi->model = g_strdup(gmc_model_str(model));
@@ -304,7 +304,7 @@ static GSList *scan_2x_bd232(GSList *options)
                goto exit_err;
        }
 
-       sdi = sr_dev_inst_new();
+       sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
        sdi->vendor = g_strdup(VENDOR_GMC);
        sdi->priv = devc;
@@ -355,7 +355,7 @@ static GSList *scan_2x_bd232(GSList *options)
                                goto exit_err;
                        }
 
-                       sdi = sr_dev_inst_new();
+                       sdi = g_malloc0(sizeof(struct sr_dev_inst));
                        sdi->status = SR_ST_INACTIVE;
                        sdi->vendor = g_strdup(VENDOR_GMC);
                }