]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/atten-pps3xxx/api.c
baylibre-acme: Driver implementation.
[libsigrok.git] / src / hardware / atten-pps3xxx / api.c
index b42036bfbd147182057226560385420419ba59cc..b72eeb4a59107aff7b415438e23efeb0c904dd71 100644 (file)
@@ -122,11 +122,11 @@ static GSList *scan(GSList *options, int modelid)
        if (!serialcomm)
                serialcomm = SERIALCOMM;
 
-       if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
-               return NULL;
+       serial = sr_serial_dev_inst_new(conn, serialcomm);
 
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
+
        serial_flush(serial);
 
        /* This is how the vendor software scans for hardware. */
@@ -164,7 +164,7 @@ static GSList *scan(GSList *options, int modelid)
                return NULL;
        }
 
-       sdi = sr_dev_inst_new();
+       sdi = g_malloc0(sizeof(struct sr_dev_inst));
        sdi->status = SR_ST_INACTIVE;
        sdi->vendor = g_strdup("Atten");
        sdi->model = g_strdup(model->name);