From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 01/23] serial: omap: define and use to_uart_omap_port()
Date: Fri, 24 Aug 2012 12:07:14 -0700 [thread overview]
Message-ID: <20120824190713.GP11011@atomide.com> (raw)
In-Reply-To: <1345717983-18179-2-git-send-email-balbi@ti.com>
* Felipe Balbi <balbi@ti.com> [120823 03:37]:
> 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>
> ---
> arch/arm/plat-omap/include/plat/omap-serial.h | 2 ++
> drivers/tty/serial/omap-serial.c | 36 +++++++++++++--------------
> 2 files changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> index 1a52725..f3b35d9 100644
> --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> @@ -137,4 +137,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__ */
For the arch/arm/*omap*/* parts:
Acked-by: Tony Lindgren <tony@atomide.com>
FYI, note that there are ARM SoC patches to move various header files to
live under include/linux/platform_data which may cause conflicts with these
changes.
Regards,
Tony
next prev parent reply other threads:[~2012-08-24 19:07 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 10:32 [PATCH v3 00/23] OMAP UART patches Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 01/23] serial: omap: define and use to_uart_omap_port() Felipe Balbi
2012-08-24 19:07 ` Tony Lindgren [this message]
2012-08-23 10:32 ` [PATCH v3 02/23] serial: omap: define helpers for pdata function pointers Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 03/23] serial: omap: don't access the platform_device Felipe Balbi
2012-08-24 19:07 ` Tony Lindgren
2012-09-05 20:27 ` Greg KH
2012-09-06 12:29 ` Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 00/21] OMAP UART Patches Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 01/21] serial: omap: don't access the platform_device Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 02/21] serial: omap: drop DMA support Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 03/21] serial: add OMAP-specific defines Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 04/21] serial: omap: simplify IRQ handling Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 05/21] serial: omap: refactor receive_chars() into rdi/rlsi handlers Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 06/21] serial: omap: move THRE check to transmit_chars() Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 07/21] serial: omap: stick to put_autosuspend Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 08/21] serial: omap: set dev->drvdata before enabling pm_runtime Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 09/21] serial: omap: drop unnecessary check from remove Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 10/21] serial: omap: make sure to suspend device before remove Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 11/21] serial: omap: don't save IRQ flags on hardirq Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 12/21] serial: omap: fix sequence of pm_runtime_* calls Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 13/21] serial: omap: optimization with section annotations Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 14/21] serial: omap: drop "inline" from IRQ handler prototype Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 15/21] serial: omap: unlock the port lock Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 16/21] serial: omap: implement set_wake Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 17/21] serial: omap: make sure to put() on poll_get_char Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 18/21] serial: omap: fix software flow control Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 19/21] serial: omap: remove unnecessary header and add a missing one Felipe Balbi
2012-09-06 12:45 ` [PATCH v4 20/21] serial: omap: move uart_omap_port definition to C file Felipe Balbi
2012-09-06 21:58 ` Kevin Hilman
2012-09-06 12:45 ` [PATCH v4 21/21] serial: omap: enable RX and TX FIFO usage Felipe Balbi
2012-09-06 16:18 ` [PATCH v4 00/21] OMAP UART Patches Greg KH
2012-09-06 17:25 ` Felipe Balbi
2012-09-06 21:37 ` Paul Walmsley
2012-09-11 22:02 ` Paul Walmsley
2012-09-12 6:23 ` Felipe Balbi
2012-09-12 20:25 ` Paul Walmsley
2012-09-13 5:01 ` Felipe Balbi
2012-09-16 1:22 ` Paul Walmsley
2012-09-16 18:36 ` Felipe Balbi
2012-09-06 22:44 ` Kevin Hilman
2012-09-07 5:49 ` Felipe Balbi
2012-09-07 20:53 ` Kevin Hilman
2012-09-08 19:04 ` Felipe Balbi
2012-09-11 11:31 ` Shubhrajyoti
2012-09-11 11:54 ` Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 04/23] serial: omap: drop DMA support Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 05/23] serial: add OMAP-specific defines Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 06/23] serial: omap: simplify IRQ handling Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 07/23] serial: omap: refactor receive_chars() into rdi/rlsi handlers Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 08/23] serial: omap: move THRE check to transmit_chars() Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 09/23] serial: omap: stick to put_autosuspend Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 10/23] serial: omap: set dev->drvdata before enabling pm_runtime Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 11/23] serial: omap: drop unnecessary check from remove Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 12/23] serial: omap: make sure to suspend device before remove Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 13/23] serial: omap: don't save IRQ flags on hardirq Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 14/23] serial: omap: fix sequence of pm_runtime_* calls Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 15/23] serial: omap: optimization with section annotations Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 16/23] serial: omap: drop "inline" from IRQ handler prototype Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 17/23] serial: omap: unlock the port lock Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 18/23] serial: omap: implement set_wake Felipe Balbi
2012-08-23 10:32 ` [PATCH v3 19/23] serial: omap: make sure to put() on poll_get_char Felipe Balbi
2012-08-23 10:33 ` [PATCH v3 20/23] serial: omap: fix software flow control Felipe Balbi
2012-08-24 19:08 ` Tony Lindgren
2012-09-05 20:27 ` Greg KH
2012-09-06 12:31 ` Felipe Balbi
2012-08-23 10:33 ` [PATCH v3 21/23] serial: omap: remove unnecessary header and add a missing one Felipe Balbi
2012-08-23 10:33 ` [PATCH v3 22/23] serial: omap: move uart_omap_port definition to C file Felipe Balbi
2012-08-24 19:08 ` Tony Lindgren
2012-08-23 10:33 ` [PATCH v3 23/23] serial: omap: enable RX and TX FIFO usage Felipe Balbi
2012-08-24 10:40 ` [PATCH v3 00/23] OMAP UART patches Felipe Balbi
2012-09-04 11:45 ` Felipe Balbi
2012-09-05 20:18 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120824190713.GP11011@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).