- sval = g_variant_get_string(data, NULL);
- if ((ival = find_str(sval, channel_modes,
- ARRAY_SIZE(channel_modes))) == -1) {
- ret = SR_ERR_ARG;
- break;
- }
- if (devc->model->channel_modes && (1 << ival) == 0) {
- /* Not supported on this model. */
- ret = SR_ERR_ARG;
- }
+ if ((ival = std_str_idx(data, ARRAY_AND_SIZE(channel_modes))) < 0)
+ return SR_ERR_ARG;
+ if (devc->model->channel_modes && (1 << ival) == 0)
+ return SR_ERR_ARG; /* Not supported on this model. */