diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-06-18 08:14:14 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-06-18 13:09:58 +0200 |
commit | e45583668e0313c422c650d5da11405624cf547c (patch) | |
tree | d068f952638389a04d98b83c32114dd6d4c142d5 /drivers/tty/mxser.c | |
parent | 292955a7c011e2351a7ed6f8d7e418d4f3fdd585 (diff) |
mxser: introduce enum mxser_must_hwid
Provided the MUST HW ID is an enumeration, define one (enum
mxser_must_hwid) and use it in the code.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-9-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/mxser.c')
-rw-r--r-- | drivers/tty/mxser.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 1865f965334a..558bd4140ee1 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -178,11 +178,6 @@ #define MXSER_PORTS (MXSER_BOARDS * MXSER_PORTS_PER_BOARD) #define MXSER_ISR_PASS_LIMIT 100 -/*CheckIsMoxaMust return value*/ -#define MOXA_OTHER_UART 0x00 -#define MOXA_MUST_MU150_HWID 0x01 -#define MOXA_MUST_MU860_HWID 0x02 - #define WAKEUP_CHARS 256 #define UART_MCR_AFE 0x20 @@ -199,6 +194,12 @@ #define MXSER_HIGHBAUD 1 +enum mxser_must_hwid { + MOXA_OTHER_UART = 0x00, + MOXA_MUST_MU150_HWID = 0x01, + MOXA_MUST_MU860_HWID = 0x02, +}; + static const struct { u8 type; u8 fifo_size; @@ -370,7 +371,7 @@ struct mxser_board { unsigned long vector; unsigned long vector_mask; - int must_hwid; + enum mxser_must_hwid must_hwid; int uart_type; struct mxser_port ports[MXSER_PORTS_PER_BOARD]; @@ -583,7 +584,7 @@ static void mxser_disable_must_rx_software_flow_control(unsigned long baseio) outb(oldlcr, baseio + UART_LCR); } -static int mxser_must_get_hwid(unsigned long io) +static enum mxser_must_hwid mxser_must_get_hwid(unsigned long io) { u8 oldmcr, hwid; int i; @@ -599,10 +600,10 @@ static int mxser_must_get_hwid(unsigned long io) } mxser_get_must_hardware_id(io, &hwid); - for (i = 1; i < UART_INFO_NUM; i++) { /* 0 = OTHER_UART */ + for (i = 1; i < UART_INFO_NUM; i++) /* 0 = OTHER_UART */ if (hwid == Gpci_uart_info[i].type) - return (int)hwid; - } + return hwid; + return MOXA_OTHER_UART; } |