gwinstek-gpd: Fix use of uninitialized variable

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
This commit is contained in:
Andreas Sandberg 2020-03-25 09:16:31 +00:00 committed by Uwe Hermann
parent 5652085a4e
commit 5ff772410b
1 changed files with 2 additions and 3 deletions

View File

@ -220,7 +220,7 @@ error:
static int config_get(uint32_t key, GVariant **data, static int config_get(uint32_t key, GVariant **data,
const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) const struct sr_dev_inst *sdi, const struct sr_channel_group *cg)
{ {
int ret, channel; int channel;
const struct dev_context *devc; const struct dev_context *devc;
const struct sr_channel *ch; const struct sr_channel *ch;
@ -244,7 +244,6 @@ static int config_get(uint32_t key, GVariant **data,
} else { } else {
ch = cg->channels->data; ch = cg->channels->data;
channel = ch->index; channel = ch->index;
ret = SR_OK;
switch (key) { switch (key) {
case SR_CONF_VOLTAGE: case SR_CONF_VOLTAGE:
*data = g_variant_new_double( *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, static int config_set(uint32_t key, GVariant *data,