]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/gwinstek-gpd/api.c
serial: flush() after open() in the serial core.
[libsigrok.git] / src / hardware / gwinstek-gpd / api.c
index ac2fe2e17409d8567a6e765f08a35119c826df3a..7406460623fe4d55d53542106c60f68629398e6d 100644 (file)
@@ -107,7 +107,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       serial_flush(serial);
        gpd_send_cmd(serial, "*IDN?\n");
        if (gpd_receive_reply(serial, reply, sizeof(reply)) != SR_OK) {
                sr_err("Device did not reply.");
@@ -220,7 +219,7 @@ error:
 static int config_get(uint32_t key, GVariant **data,
        const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
 {
-       int ret, channel;
+       int channel;
        const struct dev_context *devc;
        const struct sr_channel *ch;
 
@@ -244,7 +243,6 @@ static int config_get(uint32_t key, GVariant **data,
        } else {
                ch = cg->channels->data;
                channel = ch->index;
-               ret = SR_OK;
                switch (key) {
                case SR_CONF_VOLTAGE:
                        *data = g_variant_new_double(
@@ -267,7 +265,7 @@ static int config_get(uint32_t key, GVariant **data,
                }
        }
 
-       return ret;
+       return SR_OK;
 }
 
 static int config_set(uint32_t key, GVariant *data,