[RFC/PATCH] Fix to support multiple HWMODS for a single device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>From 24ffaa67c44065a9caa3ee3525dd863d32c67269 Mon Sep 17 00:00:00 2001
From: Kishon Vijay Abraham I <kishon@xxxxxx>
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@xxxxxx>
---
 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


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux