int idx = -1;
unsigned i;
- if (!sdi || !(devc = sdi->priv))
+ if (!sdi)
return SR_ERR_ARG;
+ devc = sdi->priv;
+
/* If a channel group is specified, it must be a valid one. */
if (cg && !g_slist_find(sdi->channel_groups, cg)) {
sr_err("Invalid channel group specified.");
}
/* Every other option requires a valid device instance. */
- if (!sdi || !(devc = sdi->priv))
+ if (!sdi)
return SR_ERR_ARG;
+ devc = sdi->priv;
/* If a channel group is specified, it must be a valid one. */
if (cg && !g_slist_find(sdi->channel_groups, cg)) {