inline int link_channel_to_component()

in core.c [551:574]


inline int link_channel_to_component(struct most_channel *c,
				     struct most_component *comp,
				     char *name,
				     char *comp_param)
{
	int ret;
	struct most_component **comp_ptr;

	if (!c->pipe0.comp)
		comp_ptr = &c->pipe0.comp;
	else if (!c->pipe1.comp)
		comp_ptr = &c->pipe1.comp;
	else
		return -ENOSPC;

	*comp_ptr = comp;
	ret = comp->probe_channel(c->iface, c->channel_id, &c->cfg, name,
				  comp_param);
	if (ret) {
		*comp_ptr = NULL;
		return ret;
	}
	return 0;
}