Clang warns:
drivers/tty/serial/mps2-uart.c:351:6: warning: logical not is only
applied to the left hand side of this bitwise operator
[-Wlogical-not-parentheses]
if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
^ ~
drivers/tty/serial/mps2-uart.c:351:6: note: add parentheses after the
'!' to evaluate the bitwise operator first
if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
^
( )
drivers/tty/serial/mps2-uart.c:351:6: note: add parentheses around left
hand side expression to silence this warning
if (!mps_port->flags & UART_PORT_COMBINED_IRQ) {
^
( )
1 warning generated.
As it was intended for this check to be the inverse of the one at the
bottom of mps2_init_port, add parentheses around the whole conditional.
Fixes: 775ea4ea2f ("serial: mps2-uart: support combined irq")
Signed-off-by: Nathan Chancellor <[email protected]>
Acked-by: Vladimir Murzin <[email protected]>
Link: https://github.com/ClangBuiltLinux/linux/issues/344
Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
It turns out that some designs went for implementing only combined
interrupt for rx, tx and overrun, which is currently not supported
by the driver. Support of combined irq is built on top of existent
irq handlers and activated automatically if only single irq was
specified in device tree.
Signed-off-by: Vladimir Murzin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Some designs, like MPS3, expose number of virtual serial ports which
already close or exceeds MPS2_MAX_PORTS. Increasing MPS2_MAX_PORTS
would have negative impact (in terms of memory consumption) on tiny
MPS2 platform which, in fact, has only one physically populated UART.
Start with converting existent static port array to idr. As a bonus it
make driver not to fail in case when no alias was specified in device
tree.
Note: there is no need in idr_destroy() because code doesn't unload
since ce87122911 ("serial: mps2-uart: make driver explicitly non-modular")
Signed-off-by: Vladimir Murzin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The Kconfig currently controlling compilation of mps2-uart is:
config SERIAL_MPS2_UART
bool "MPS2 UART port"
depends on ARM || COMPILE_TEST
...meaning that it currently is not being built as a module by anyone.
Follow commit 89ebc27427 ("drivers/tty: make serial/mvebu-uart.c
explicitly non-modular") as an example of moving modular code to
non-modular:
- remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
- explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.
- use arch_initcall instead of module_init and remove module_exit.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.
Reported-by: Paul Gortmaker <[email protected]>
Signed-off-by: Vladimir Murzin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This adds support early console for MPS2 UART which can be enabled via
earlycon=mps2,0x40004000
Acked-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Peter Hurley <[email protected]>
Signed-off-by: Vladimir Murzin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This driver adds support to the UART controller found on ARM MPS2
platform.
Acked-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Vladimir Murzin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>