]> git.baikalelectronics.ru Git - kernel.git/commit
serial: sprd: check the right port and membase
authorChunyan Zhang <chunyan.zhang@unisoc.com>
Mon, 26 Aug 2019 07:29:27 +0000 (15:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:55 +0000 (12:43 +0200)
commitbd0cb672ea5f8898fe6b75a33d86dc86f26c823e
treef36c428effce9da529eadb61e16d142977e5eece
parent014babe4125c3048ea6f30efc4a4cfc3a309de40
serial: sprd: check the right port and membase

When calling sprd_console_setup(), sprd_uart_port probably is NULL,
we should check that first instead of checking its items directly.

Also we should check membase to avoid accessing uart device before
its initialization finished.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Tested-by: Baolin Wang <baolin.wang@linaro.org>
Link: https://lore.kernel.org/r/20190826072929.7696-2-zhang.lyra@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sprd_serial.c