diff mbox

[04/12] OMAP: omap_device: ensure hwmod tracks attached omap_device pointer

Message ID 1276733833-18510-5-git-send-email-khilman@deeprootsystems.com (mailing list archive)
State Superseded
Delegated to: Kevin Hilman
Headers show

Commit Message

Kevin Hilman June 17, 2010, 12:17 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f899603..6614cba 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -359,8 +359,8 @@  struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	struct omap_device *od;
 	char *pdev_name2;
 	struct resource *res = NULL;
-	int res_count;
-	struct omap_hwmod **hwmods;
+	int i, res_count;
+	struct omap_hwmod *oh, **hwmods;
 
 	if (!ohs || oh_cnt == 0 || !pdev_name)
 		return ERR_PTR(-EINVAL);
@@ -416,6 +416,10 @@  struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	else
 		ret = omap_device_register(od);
 
+	/* each hwmod has a pointer to its attached omap_device */
+	for (i = 0, oh = hwmods[0]; i < oh_cnt; i++, oh++)
+		oh->od = od;
+
 	if (ret)
 		goto odbs_exit4;