Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/9] OMAP2+: hwmod: allow multiple calls to omap_hwmod_init()
Date: Mon, 28 Feb 2011 14:12:17 -0700	[thread overview]
Message-ID: <20110228211214.15286.63298.stgit@twilight.localdomain> (raw)
In-Reply-To: <20110228210858.15286.3200.stgit@twilight.localdomain>

There's no longer any reason why we should prevent multiple
calls to omap_hwmod_init().  It is now simply used to register an
array of hwmods.

This should allow a subset of hwmods (e.g., hwmods
handling the system clocksource and clockevents) to be registered
earlier than the remaining mass of hwmods.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Beno?t Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 9e89a58..2a7ab6a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list);
 /* mpu_oh: used to add/remove MPU initiator from sleepdep list */
 static struct omap_hwmod *mpu_oh;
 
-/* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */
-static u8 inited;
-
 
 /* Private functions */
 
@@ -1595,26 +1592,20 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
  */
 int __init omap_hwmod_init(struct omap_hwmod **ohs)
 {
-	struct omap_hwmod *oh;
-	int r;
-
-	if (inited)
-		return -EINVAL;
-
-	inited = 1;
+	int r, i;
 
 	if (!ohs)
 		return 0;
 
-	oh = *ohs;
-	while (oh) {
-		if (omap_chip_is(oh->omap_chip)) {
-			r = _register(oh);
-			WARN(r, "omap_hwmod: %s: _register returned "
-			     "%d\n", oh->name, r);
-		}
-		oh = *++ohs;
-	}
+	i = 0;
+	do {
+		if (!omap_chip_is(ohs[i]->omap_chip))
+			continue;
+
+		r = _register(ohs[i]);
+		WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name,
+		     r);
+	} while (ohs[++i]);
 
 	return 0;
 }

  parent reply	other threads:[~2011-02-28 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 21:12 [PATCH v2 0/9] OMAP2+: hwmod/clockevent: allow hwmods to be set up individually Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 1/9] OMAP2420: hwmod data: add dmtimer Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 2/9] OMAP2430: " Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 3/9] OMAP3: " Paul Walmsley
2011-02-28 21:12 ` Paul Walmsley [this message]
2011-02-28 21:12 ` [PATCH v2 5/9] OMAP2+: hwmod: rename some init functions Paul Walmsley
2011-03-01  6:53   ` DebBarma, Tarun Kanti
2011-02-28 21:12 ` [PATCH v2 6/9] OMAP2+: hwmod: find MPU initiator hwmod during in _register() Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 7/9] OMAP2+: hwmod: ignore attempts to re-setup a hwmod Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 8/9] OMAP2+: hwmod: add ability to setup individual hwmods Paul Walmsley
2011-02-28 21:12 ` [PATCH v2 9/9] OMAP2+: clockevent: set up GPTIMER clockevent hwmod right before timer init Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110228211214.15286.63298.stgit@twilight.localdomain \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox