From patchwork Fri Sep 9 22:37:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 75925 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp569904qgf; Fri, 9 Sep 2016 15:37:57 -0700 (PDT) X-Received: by 10.66.72.8 with SMTP id z8mr10598362pau.141.1473460674753; Fri, 09 Sep 2016 15:37:54 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ku8si5996599pab.26.2016.09.09.15.37.54; Fri, 09 Sep 2016 15:37:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755789AbcIIWhw (ORCPT + 2 others); Fri, 9 Sep 2016 18:37:52 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34591 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755609AbcIIWhW (ORCPT ); Fri, 9 Sep 2016 18:37:22 -0400 Received: by mail-oi0-f67.google.com with SMTP id a144so4268323oii.1; Fri, 09 Sep 2016 15:37:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=av+c/ox7EBRupxs9pwnzOXBjCiIaQSijgVNHtUt2sf0=; b=fCwTba5HjyQpo77GIPWhScMdzVvuvbCpfNPUWIAljtaVZ3WSugwJb3gG6wwVhkbZIr 0WknhsFg71e7re4mY24NlOLhB4i8lZsA3ircTBwN9iFCWBdtBrcTvGW53azRx5p7Vw50 OuFK5WS7yPEu+qteK6Y39F15gaWJr/bfzoATvoBrOEUpDG/BKx7Ob9duwbTEwZsv6Lf7 obSM+lQu7JI7aGLWSnoCpD0Q4LtFm6LN/JE6dyp5dhUX82JuKn8aZf8kyUWwkZdVdQX/ LZawEYkq3/NZ1o+MDmhc9GsnEIClGoecGT8fP4ZvxdA+hf2FnkDPNDbYdX/GRbx4P1aM 0qTA== X-Gm-Message-State: AE9vXwPdWP7CgxviZcY4CTLVVHmSlX0W1FkBY6GfDmp/yyyv+yNpHO8P/JCd3XNXEDnxuQ== X-Received: by 10.202.252.10 with SMTP id a10mr10322412oii.124.1473460641871; Fri, 09 Sep 2016 15:37:21 -0700 (PDT) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id v185sm1902378oie.24.2016.09.09.15.37.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Sep 2016 15:37:21 -0700 (PDT) From: Rob Herring To: Alan Cox , Greg Kroah-Hartman , Jiri Slaby , Peter Hurley Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 8/9] tty: serial_core: remove dependence on tty->driver_data Date: Fri, 9 Sep 2016 17:37:09 -0500 Message-Id: <20160909223711.26238-9-robh@kernel.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909223711.26238-1-robh@kernel.org> References: <20160909223711.26238-1-robh@kernel.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org As the uart_state contains tty_port, use that to get the uart_state ptr. Signed-off-by: Rob Herring --- drivers/tty/serial/serial_core.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 8f2b52174263..b9ec9fd688a2 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -120,7 +120,7 @@ void uart_write_wakeup(struct uart_port *port) static void uart_stop(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; @@ -138,7 +138,7 @@ static void __uart_start(struct uart_port *port) static void uart_start(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; @@ -517,7 +517,7 @@ static void uart_change_speed(struct tty_port *port, struct ktermios *old_termio static int uart_put_char(struct tty_struct *tty, unsigned char c) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; struct circ_buf *circ; unsigned long flags; @@ -545,7 +545,7 @@ static void uart_flush_chars(struct tty_struct *tty) static int uart_write(struct tty_struct *tty, const unsigned char *buf, int count) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *uport; struct circ_buf *circ; unsigned long flags; @@ -585,7 +585,7 @@ static int uart_write(struct tty_struct *tty, static int uart_write_room(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; int ret; @@ -598,7 +598,7 @@ static int uart_write_room(struct tty_struct *tty) static int uart_chars_in_buffer(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; int ret; @@ -611,7 +611,7 @@ static int uart_chars_in_buffer(struct tty_struct *tty) static void uart_flush_buffer(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; @@ -642,7 +642,7 @@ static void uart_flush_buffer(struct tty_struct *tty) */ static void uart_send_xchar(struct tty_struct *tty, char ch) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long flags; @@ -664,7 +664,7 @@ static void uart_send_xchar(struct tty_struct *tty, char ch) static void uart_throttle(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; upstat_t mask = 0; @@ -693,7 +693,7 @@ static void uart_throttle(struct tty_struct *tty) static void uart_unthrottle(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; upstat_t mask = 0; @@ -1026,7 +1026,7 @@ static int uart_get_lsr_info(struct tty_struct *tty, static int uart_tiocmget(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port = &state->port; struct uart_port *uport; int result = -EIO; @@ -1050,7 +1050,7 @@ out: static int uart_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port = &state->port; struct uart_port *uport; int ret = -EIO; @@ -1071,7 +1071,7 @@ out: static int uart_break_ctl(struct tty_struct *tty, int break_state) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port = &state->port; struct uart_port *uport; int ret = -EIO; @@ -1221,7 +1221,7 @@ static int uart_wait_modem_status(struct uart_state *state, unsigned long arg) static int uart_get_icount(struct tty_struct *tty, struct serial_icounter_struct *icount) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_icount cnow; struct uart_port *uport; @@ -1295,7 +1295,7 @@ static int uart_set_rs485_config(struct uart_port *port, static int uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port = &state->port; struct uart_port *uport; void __user *uarg = (void __user *)arg; @@ -1386,7 +1386,7 @@ out: static void uart_set_ldisc(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *uport; mutex_lock(&state->port.mutex); @@ -1400,7 +1400,7 @@ static void uart_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { struct tty_port *port = tty->port; - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(port); struct uart_port *uport; unsigned int cflag = tty->termios.c_cflag; unsigned int iflag_mask = IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK; @@ -1461,7 +1461,7 @@ out: */ static void uart_close(struct tty_struct *tty, struct file *filp) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port; if (!state) { @@ -1512,7 +1512,7 @@ static void uart_tty_port_shutdown(struct tty_port *port) static void uart_wait_until_sent(struct tty_struct *tty, int timeout) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct uart_port *port; unsigned long char_time, expire; @@ -1576,7 +1576,7 @@ static void uart_wait_until_sent(struct tty_struct *tty, int timeout) */ static void uart_hangup(struct tty_struct *tty) { - struct uart_state *state = tty->driver_data; + struct uart_state *state = tty_port_to_uart_state(tty->port); struct tty_port *port = &state->port; struct uart_port *uport; unsigned long flags;