linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] Fix to support multiple HWMODS for a single device
@ 2010-08-22  9:50 kishon
  0 siblings, 0 replies; only message in thread
From: kishon @ 2010-08-22  9:50 UTC (permalink / raw)
  To: linux-omap, Partha Basak
  Cc: Datta, Shubhrajyoti, Varadarajan, Charulatha, Nishant Kamat,
	ABRAHAM, KISHON VIJAY

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-RFC-PATCH-Fix-to-support-multiple-HWMODS-for-a-singl.patch --]
[-- Type: text/x-patch, Size: 1888 bytes --]

>From 24ffaa67c44065a9caa3ee3525dd863d32c67269 Mon Sep 17 00:00:00 2001
From: Kishon Vijay Abraham I <kishon@ti.com>
Date: Sun, 22 Aug 2010 15:06:42 +0530
Subject: [RFC/PATCH] Fix to support multiple HWMODS for a single device

The current code expects multiple HWMODS to be filled in consecutive
memory location before passing to omap_device_build_ss(). Ignoring this
will result in incorrect data being populated in omap_hwmod_fill_resources().
This means before calling omap_device_build_ss() the user has to create memory
chunks, copy all the HWMOD structures to it taking care of the mutex
variable as well.

This fix does some pointer calculations to the existing function
omap_device_fill_resources() in order to fill the resources properly.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 arch/arm/plat-omap/omap_device.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 arch/arm/plat-omap/omap_device.c

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
old mode 100644
new mode 100755
index d2b1609..8013292
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -289,12 +289,12 @@ int omap_device_count_resources(struct omap_device *od)
  */
 int omap_device_fill_resources(struct omap_device *od, struct resource *res)
 {
-	struct omap_hwmod *oh;
+	struct omap_hwmod **oh;
 	int c = 0;
 	int i, r;
 
-	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++) {
-		r = omap_hwmod_fill_resources(oh, res);
+	for (i = 0, oh = od->hwmods; i < od->hwmods_cnt; i++, oh++) {
+		r = omap_hwmod_fill_resources(*oh, res);
 		res += r;
 		c += r;
 	}
@@ -694,7 +694,6 @@ int omap_device_enable_hwmods(struct omap_device *od)
 {
 	struct omap_hwmod *oh;
 	int i;
-
 	for (i = 0, oh = *od->hwmods; i < od->hwmods_cnt; i++, oh++)
 		omap_hwmod_enable(oh);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-22  9:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-22  9:50 [RFC/PATCH] Fix to support multiple HWMODS for a single device kishon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).