rigol-ds: Fix check for probe group validity.
This commit is contained in:
parent
55eb33dbf8
commit
969edf6306
|
@ -464,13 +464,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_ARG;
|
||||
|
||||
/* If a probe group is specified, it must be a valid one. */
|
||||
if (probe_group) {
|
||||
if (probe_group != &devc->analog_groups[0]
|
||||
&& probe_group != &devc->analog_groups[1]) {
|
||||
if (probe_group && !g_slist_find(sdi->probe_groups, probe_group))
|
||||
{
|
||||
sr_err("Invalid probe group specified.");
|
||||
return SR_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case SR_CONF_NUM_TIMEBASE:
|
||||
|
@ -510,13 +508,11 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_DEV_CLOSED;
|
||||
|
||||
/* If a probe group is specified, it must be a valid one. */
|
||||
if (probe_group) {
|
||||
if (probe_group != &devc->analog_groups[0]
|
||||
&& probe_group != &devc->analog_groups[1]) {
|
||||
if (probe_group && !g_slist_find(sdi->probe_groups, probe_group))
|
||||
{
|
||||
sr_err("Invalid probe group specified.");
|
||||
return SR_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
ret = SR_OK;
|
||||
switch (id) {
|
||||
|
|
Loading…
Reference in New Issue