- if (changes & SR_CHANNEL_SET_ENABLED) {
- if (ch->enabled) {
- v = devc->channel | (1 << ch->index);
- if (v & (v - 1))
- return SR_ERR;
- devc->channel = v;
- devc->enabled_channel->data = ch;
- } else {
- devc->channel &= ~(1 << ch->index);
- }
+ if (!(changes & SR_CHANNEL_SET_ENABLED))
+ return SR_OK;
+
+ if (ch->enabled) {
+ v = devc->channel | (1 << ch->index);
+ if (v & (v - 1))
+ return SR_ERR;
+ devc->channel = v;
+ devc->enabled_channel->data = ch;
+ } else {
+ devc->channel &= ~(1 << ch->index);