]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/gwinstek-gpd/api.c
gwinstek-gpd: Fix use of uninitialized variable
[libsigrok.git] / src / hardware / gwinstek-gpd / api.c
index 79688afb6595f7efacfde7df6c8e1c868cea96fd..3234240fddbb65492ddc4307d7526fde2f7886f4 100644 (file)
@@ -220,7 +220,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 +244,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 +266,7 @@ static int config_get(uint32_t key, GVariant **data,
                }
        }
 
-       return ret;
+       return SR_OK;
 }
 
 static int config_set(uint32_t key, GVariant *data,
@@ -384,7 +383,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
        return SR_OK;
 }
 
-SR_PRIV const struct sr_dev_driver gwinstek_gpd_driver_info = {
+static struct sr_dev_driver gwinstek_gpd_driver_info = {
        .name = "gwinstek-gpd",
        .longname = "GW Instek GPD",
        .api_version = 1,