fx2lafw: tidy up config_set().

This commit is contained in:
Martin Ling 2014-04-15 11:23:51 +01:00 committed by Bert Vermeulen
parent a920a7d899
commit 1c48000dc7
1 changed files with 15 additions and 8 deletions

View File

@ -393,19 +393,26 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
(void)cg; (void)cg;
if (!sdi)
return SR_ERR_ARG;
if (sdi->status != SR_ST_ACTIVE) if (sdi->status != SR_ST_ACTIVE)
return SR_ERR; return SR_ERR;
devc = sdi->priv; devc = sdi->priv;
if (id == SR_CONF_SAMPLERATE) { ret = SR_OK;
devc->cur_samplerate = g_variant_get_uint64(data);
ret = SR_OK; switch (id)
} else if (id == SR_CONF_LIMIT_SAMPLES) { {
devc->limit_samples = g_variant_get_uint64(data); case SR_CONF_SAMPLERATE:
ret = SR_OK; devc->cur_samplerate = g_variant_get_uint64(data);
} else { break;
ret = SR_ERR_NA; case SR_CONF_LIMIT_SAMPLES:
devc->limit_samples = g_variant_get_uint64(data);
break;
default:
ret = SR_ERR_NA;
} }
return ret; return ret;