/* Called from _init_clocks(). Populates the @oh _clk (main functional clock pointer) if a main_clk is present. Returns 0 on success or -EINVAL on error.  */
static int _init_main_clk(struct omap_hwmod *oh)
/* Called from _init_clocks(). Populates the @oh _clk (main functional clock pointer) if a main_clk is present. Returns 0 on success or -EINVAL on error.  */
static int _init_main_clk(struct omap_hwmod *oh)
{
	struct clk *c;
	int ret = 0;
	if (!oh->clkdev_con_id)
		return 0;
	c = clk_get_sys(oh->clkdev_dev_id, oh->clkdev_con_id);
	WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s.%s\n",
	     oh->name, oh->clkdev_dev_id, oh->clkdev_con_id);
	if (IS_ERR(c))
		ret = -EINVAL;
	oh->_clk = c;
	WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n",
	     oh->clkdev_con_id, c->name);
	return ret;
}