]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/norma-dmm/api.c
output/csv: use intermediate time_t var, silence compiler warning
[libsigrok.git] / src / hardware / norma-dmm / api.c
index 094fe951cf165b671604f762fc31539176e75a58..84ca43ca8351c4761309ffc61a949b671ec9c8de 100644 (file)
@@ -99,8 +99,6 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       serial_flush(serial);
-
        buf = g_malloc(BUF_MAX);
 
        snprintf(req, sizeof(req), "%s\r\n",
@@ -110,6 +108,7 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
                if (serial_write_blocking(serial, req, strlen(req),
                                serial_timeout(serial, strlen(req))) < 0) {
                        sr_err("Unable to send identification request.");
+                       g_free(buf);
                        return NULL;
                }
                len = BUF_MAX;
@@ -159,8 +158,8 @@ static GSList *scan(struct sr_dev_driver *drv, GSList *options)
        return std_scan_complete(drv, devices);
 }
 
-static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_set(uint32_t key, GVariant *data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
 
@@ -171,8 +170,8 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
        return sr_sw_limits_config_set(&devc->limits, key, data);
 }
 
-static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
-               const struct sr_channel_group *cg)
+static int config_list(uint32_t key, GVariant **data,
+       const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
        return STD_CONFIG_LIST(key, data, sdi, cg, scanopts, drvopts, devopts);
 }