summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2021-06-18 08:14:42 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-18 13:10:01 +0200
commitd811b26ba3a78d45ccfc8e562323d9104d321c87 (patch)
tree27dbb675175827aacefa6b4f9c021bbba4933fe6
parenta6970c39c311f393c2a2b43733e1b4ce2b241f53 (diff)
mxser: drop mxser_port::custom_divisor
It's an once-set constant, so define a macro for the constant (MXSER_CUSTOM_DIVISOR) and use it in the code instead. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-37-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/mxser.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 204b71c4d1ae..c4ee5cb6952e 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -157,6 +157,7 @@
#define WAKEUP_CHARS 256
#define MXSER_BAUD_BASE 921600
+#define MXSER_CUSTOM_DIVISOR (MXSER_BAUD_BASE * 16)
#define PCI_DEVICE_ID_POS104UL 0x1044
#define PCI_DEVICE_ID_CB108 0x1080
@@ -284,8 +285,6 @@ struct mxser_port {
unsigned char ldisc_stop_rx;
- int custom_divisor;
-
struct async_icount icount; /* kernel counters for 4 input interrupts */
unsigned int timeout;
@@ -1226,7 +1225,7 @@ static int mxser_get_serial_info(struct tty_struct *tty,
ss->baud_base = MXSER_BAUD_BASE,
ss->close_delay = close_delay;
ss->closing_wait = closing_wait;
- ss->custom_divisor = info->custom_divisor,
+ ss->custom_divisor = MXSER_CUSTOM_DIVISOR,
mutex_unlock(&port->mutex);
return 0;
}
@@ -1285,7 +1284,7 @@ static int mxser_set_serial_info(struct tty_struct *tty,
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST &&
(ss->baud_base != MXSER_BAUD_BASE ||
ss->custom_divisor !=
- info->custom_divisor)) {
+ MXSER_CUSTOM_DIVISOR)) {
if (ss->custom_divisor == 0) {
mutex_unlock(&port->mutex);
return -EINVAL;
@@ -2019,7 +2018,6 @@ static int mxser_initbrd(struct mxser_board *brd)
process_txrx_fifo(info);
- info->custom_divisor = MXSER_BAUD_BASE * 16;
info->port.close_delay = 5 * HZ / 10;
info->port.closing_wait = 30 * HZ;
spin_lock_init(&info->slock);