aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/plat/omap-serial.h
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-08-23 13:32:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 13:26:10 -0700
commitc990f3510357586be63bbe9faf7972212a0dc78f (patch)
treef31e6ce4928c549a80637c968f1b3924de981339 /arch/arm/plat-omap/include/plat/omap-serial.h
parentbe282059acebcecd789fad1b3d17d826db3d5608 (diff)
serial: omap: define and use to_uart_omap_port()
current code only works because struct uart_port is the first member on the uart_omap_port structure. If, for whatever reason, someone puts another member as the first of the structure, that cast won't work anymore. In order to be safe, let's use a container_of() which, for now, gets optimized into a cast anyway. Tested-by: Shubhrajyoti D <shubhrajyoti@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/omap-serial.h')
-rw-r--r--arch/arm/plat-omap/include/plat/omap-serial.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 52d3de45745..5cc06262071 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -144,4 +144,6 @@ struct uart_omap_port {
struct work_struct qos_work;
};
+#define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port)))
+
#endif /* __OMAP_SERIAL_H__ */