- if (!ch) {
- sr_err("%s: channel was NULL.", __func__);
- return SR_ERR;
- }
-
- /* Skip disabled channels. */
- if (!ch->enabled)
- continue;
-
- /* Skip (enabled) channels with no configured trigger. */
- if (!ch->trigger)
- continue;
-
- /* Note: Must only be run if ch->trigger != NULL. */
- if (ch->index < 0 || ch->index > (int)devc->prof->num_channels - 1) {
- sr_err("Invalid channel index %d, must be "
- "between 0 and %d.", ch->index,
- devc->prof->num_channels - 1);
- return SR_ERR;
- }
-
- channel_bit = (1 << (ch->index));
-
- /* Configure the channel's trigger pattern/mask/edgemask. */
- for (tc = ch->trigger; tc && *tc; tc++) {
- devc->trigger_mask |= channel_bit;