From: Kevin Hilman Date: Tue, 8 Dec 2009 23:34:17 +0000 (-0700) Subject: OMAP: omap_device: add to_omap_device() macro X-Git-Tag: v2.6.33-rc1~295^2~1^2~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a470c42cb89a5282f816b37a0d1eef68fe455f31;p=karo-tx-linux.git 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. Signed-off-by: Kevin Hilman Signed-off-by: Paul Walmsley --- diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h index 11a9773a4e7f..d93924699a1b 100644 --- a/arch/arm/plat-omap/include/plat/omap_device.h +++ b/arch/arm/plat-omap/include/plat/omap_device.h @@ -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