Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit edb20c7a authored by Fabian Frederick's avatar Fabian Frederick Committed by Greg Kroah-Hartman
Browse files

tty: use container_of to resolve uart_pmac_port from uart_port



Use container_of instead of casting first structure member.

Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a15ad348
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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)