/* Intended to be called early in boot before the clock framework is initialized. If @ohs is not null, will register all omap_hwmods listed in @ohs that are valid for this chip. Returns -EINVAL if omap_hwmod_init() has already been called or 0 otherwise.  */
int omap_hwmod_init(struct omap_hwmod **ohs)
/* Intended to be called early in boot before the clock framework is initialized. If @ohs is not null, will register all omap_hwmods listed in @ohs that are valid for this chip. Returns -EINVAL if omap_hwmod_init() has already been called or 0 otherwise.  */
int omap_hwmod_init(struct omap_hwmod **ohs)
{
	struct omap_hwmod *oh;
	int r;
	if (inited)
		return -EINVAL;
	inited = 1;
	if (!ohs)
		return 0;
	oh = *ohs;
	while (oh) {
		if (omap_chip_is(oh->omap_chip)) {
			r = omap_hwmod_register(oh);
			WARN(r, "omap_hwmod: %s: omap_hwmod_register returned "
			     "%d\n", oh->name, r);
		}
		oh = *++ohs;
	}
	return 0;
}