summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-07-21 13:58:51 -0700
committerKevin Hilman <khilman@ti.com>2011-09-15 16:35:47 -0700
commitd66b3fe436a296f102e8944247972fc0c17ddf26 (patch)
treed1b15398c457f54380fb50ed3fb8d6756043cb0c /arch/arm/plat-omap/include
parent9f8b6949d78f1306eef0edc14bc1fbcaf3e58ad0 (diff)
OMAP: omap_device: decouple platform_device from omap_device
Rather than embedding a struct platform_device inside a struct omap_device, decouple them, leaving only a pointer to the platform_device inside the omap_device. Use the arch-specific data field of the platform_device (pdev_archdata) to add an omap_device pointer after the platform_device has been created. Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/include')
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 4f98770b1d8c..d4d9b96f961e 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -68,7 +68,7 @@ extern struct device omap_device_parent;
*
*/
struct omap_device {
- struct platform_device pdev;
+ struct platform_device *pdev;
struct omap_hwmod **hwmods;
struct omap_device_pm_latency *pm_lats;
u32 dev_wakeup_lat;
@@ -146,7 +146,10 @@ struct omap_device_pm_latency {
#define OMAP_DEVICE_LATENCY_AUTO_ADJUST BIT(1)
/* Get omap_device pointer from platform_device pointer */
-#define to_omap_device(x) container_of((x), struct omap_device, pdev)
+static inline struct omap_device *to_omap_device(struct platform_device *pdev)
+{
+ return pdev ? pdev->archdata.od : NULL;
+}
static inline
void omap_device_disable_idle_on_suspend(struct platform_device *pdev)