]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/api.c
dmm/bm52x: silence overzealous compiler warning
[libsigrok.git] / src / hardware / motech-lps-30x / api.c
index af3ee4f0aecbe504943b9aafb215c6ddc3395769..31bbfa43827f6c75fecb628bb461f093592fd51e 100644 (file)
@@ -363,13 +363,12 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
 
        sdi = NULL;
        devc = NULL;
-       conn = serialcomm = NULL;
 
        /* Process and check options. */
+       conn = NULL;
+       serialcomm = SERIALCOMM;
        if (sr_serial_extract_options(options, &conn, &serialcomm) != SR_OK)
                return NULL;
-       if (!serialcomm)
-               serialcomm = SERIALCOMM;
 
        /* Init serial port. */
        serial = sr_serial_dev_inst_new(conn, serialcomm);
@@ -378,7 +377,6 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
                goto exit_err;
 
        /* Query and verify model string. */
-       serial_flush(serial);
        if (lps_cmd_reply(buf, serial, "MODEL") != SR_OK)
                return NULL;
 
@@ -441,7 +439,7 @@ static GSList *do_scan(lps_modelid modelid, struct sr_dev_driver *drv, GSList *o
                devc->channel_status[cnt].info = g_slist_append(NULL, ch);
 
                cg = g_malloc(sizeof(struct sr_channel_group));
-               snprintf(channel, sizeof(channel), "CG%d", cnt+1);
+               snprintf(channel, sizeof(channel), "CG%d", cnt + 1);
                cg->name = g_strdup(channel);
                cg->priv = NULL;
                cg->channels = g_slist_append(NULL, ch);