diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-10-05 19:01:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 19:20:52 -0800 |
commit | edb20c7aa5080f983af562d117c577975c9c392e (patch) | |
tree | 25d88f1089cbcfddd5ec04ef469d8ec592c1482c | |
parent | a15ad34834b1b29459ae87b0f04489d0765259e8 (diff) |
tty: use container_of to resolve uart_pmac_port from uart_port
Use container_of instead of casting first structure member.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/pmac_zilog.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index abbfedb84901..4aca3229b7bb 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1352,7 +1352,8 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser) static int pmz_poll_get_char(struct uart_port *port) { - struct uart_pmac_port *uap = (struct uart_pmac_port *)port; + struct uart_pmac_port *uap = + container_of(port, struct uart_pmac_port, port); int tries = 2; while (tries) { @@ -1367,7 +1368,8 @@ static int pmz_poll_get_char(struct uart_port *port) static void pmz_poll_put_char(struct uart_port *port, unsigned char c) { - struct uart_pmac_port *uap = (struct uart_pmac_port *)port; + struct uart_pmac_port *uap = + container_of(port, struct uart_pmac_port, port); /* Wait for the transmit buffer to empty. */ while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0) @@ -1954,7 +1956,8 @@ static void __exit exit_pmz(void) static void pmz_console_putchar(struct uart_port *port, int ch) { - struct uart_pmac_port *uap = (struct uart_pmac_port *)port; + struct uart_pmac_port *uap = + container_of(port, struct uart_pmac_port, port); /* Wait for the transmit buffer to empty. */ while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0) |