sysclk-lwla: Make use of the probe index again.

(configure_probes): sr_probe::index has been un-deprecated,
so use it instead of relying on the list order.
This commit is contained in:
Daniel Elstner 2014-01-15 11:09:06 +01:00
parent d02d475442
commit 0b92c32cb8
1 changed files with 7 additions and 8 deletions

View File

@ -357,18 +357,17 @@ static int configure_probes(const struct sr_dev_inst *sdi)
devc->trigger_edge_mask = 0; devc->trigger_edge_mask = 0;
devc->trigger_values = 0; devc->trigger_values = 0;
for (node = sdi->probes, probe_bit = 1; for (node = sdi->probes; node != NULL; node = node->next) {
node != NULL;
node = node->next, probe_bit <<= 1) {
if (probe_bit >= ((uint64_t)1 << NUM_PROBES)) {
sr_err("Channels over the limit of %d.", NUM_PROBES);
return SR_ERR;
}
probe = node->data; probe = node->data;
if (!probe || !probe->enabled) if (!probe || !probe->enabled)
continue; continue;
if (probe->index >= NUM_PROBES) {
sr_err("Channel index %d out of range.", probe->index);
return SR_ERR_BUG;
}
probe_bit = (uint64_t)1 << probe->index;
/* Enable input channel for this probe. */ /* Enable input channel for this probe. */
devc->channel_mask |= probe_bit; devc->channel_mask |= probe_bit;