Skip to contentSkip to conversation

OMAP: omap_device: add to_omap_device() macro

PATCH In review Kevin Hilman 2 participants 2 messages Nov 24, 2009 – Dec 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: omap_device: add to_omap_device() macro

Following the model of to_platform_device(), add to_omap_device() macro so a platform_device pointer can be converted into an omap_device pointer.

---
 arch/arm/plat-omap/include/plat/omap_device.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/plat-omap/include/plat/omap_device.h +3 -1
index 11a9773..d939246 100644
@@ -137,5 +137,7 @@ struct omap_device_pm_latency {
 };
 
 
-#endif
+/* Get omap_device pointer from platform_device pointer */
+#define to_omap_device(x) container_of((x), struct omap_device, pdev)
 
+#endif
Signature · 1 line
1.6.5.1
#1 lore raw
Quoted 5 lines · Kevin Hilman

Following the model of to_platform_device(), add to_omap_device() macro so a platform_device pointer can be converted into an omap_device pointer.

Thanks, I'll add this to the rest of the hwmod patches for 2.6.33.

- Paul