From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932370AbcELJCA (ORCPT ); Thu, 12 May 2016 05:02:00 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35877 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658AbcELIuY (ORCPT ); Thu, 12 May 2016 04:50:24 -0400 From: Mathieu OTHACEHE To: johan@kernel.org Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu OTHACEHE Subject: [PATCH 11/36] usb: serial: ti_usb_3410_5052: Use C_X macros instead of c_cflag manipulation Date: Thu, 12 May 2016 10:48:43 +0200 Message-Id: <1463042948-12205-12-git-send-email-m.othacehe@gmail.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463042948-12205-1-git-send-email-m.othacehe@gmail.com> References: <1463042948-12205-1-git-send-email-m.othacehe@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use C_X tty.h macros to avoid direct manipulation of termios c_cflag variable. Signed-off-by: Mathieu OTHACEHE --- drivers/usb/serial/ti_usb_3410_5052.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index ef6789b..601fab6 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -936,7 +936,7 @@ static void ti_set_termios(struct tty_struct *tty, config->wFlags |= TI_UART_ENABLE_AUTO_START_DMA; config->bUartMode = tport->tp_uart_mode; - switch (cflag & CSIZE) { + switch (C_CSIZE(tty)) { case CS5: config->bDataBits = TI_UART_5_DATA_BITS; break; @@ -955,8 +955,8 @@ static void ti_set_termios(struct tty_struct *tty, /* CMSPAR isn't supported by this driver */ tty->termios.c_cflag &= ~CMSPAR; - if (cflag & PARENB) { - if (cflag & PARODD) { + if (C_PARENB(tty)) { + if (C_PARODD(tty)) { config->wFlags |= TI_UART_ENABLE_PARITY_CHECKING; config->bParity = TI_UART_ODD_PARITY; } else { @@ -968,14 +968,14 @@ static void ti_set_termios(struct tty_struct *tty, config->bParity = TI_UART_NO_PARITY; } - if (cflag & CSTOPB) + if (C_CSTOPB(tty)) config->bStopBits = TI_UART_2_STOP_BITS; else config->bStopBits = TI_UART_1_STOP_BITS; - if (cflag & CRTSCTS) { + if (C_CRTSCTS(tty)) { /* RTS flow control must be off to drop RTS for baud rate B0 */ - if ((cflag & CBAUD) != B0) + if ((C_BAUD(tty)) != B0) config->wFlags |= TI_UART_ENABLE_RTS_IN; config->wFlags |= TI_UART_ENABLE_CTS_OUT; } else { @@ -1004,7 +1004,7 @@ static void ti_set_termios(struct tty_struct *tty, config->wBaudRate = (__u16)((461538 + baud/2) / baud); /* FIXME: Should calculate resulting baud here and report it back */ - if ((cflag & CBAUD) != B0) + if ((C_BAUD(tty)) != B0) tty_encode_baud_rate(tty, baud, baud); dev_dbg(&port->dev, @@ -1026,7 +1026,7 @@ static void ti_set_termios(struct tty_struct *tty, /* SET_CONFIG asserts RTS and DTR, reset them correctly */ mcr = tport->tp_shadow_mcr; /* if baud rate is B0, clear RTS and DTR */ - if ((cflag & CBAUD) == B0) + if (C_BAUD(tty) == B0) mcr &= ~(TI_MCR_DTR | TI_MCR_RTS); status = ti_set_mcr(tport, mcr); if (status) -- 2.8.2