aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/8250/8250_hisi_lpc.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2016-10-18 12:53:00 +0800
committerGraeme Gregory <graeme.gregory@linaro.org>2017-06-06 10:00:43 +0100
commit0d2d2a67c95fd4304dd00b935a6695131e9ab12b (patch)
treef2b96878117f906c7fd0c5913db095d7c65f2dea /drivers/tty/serial/8250/8250_hisi_lpc.c
parentaa6a05a8e11dc75328502e98204f6ea7ff597ada (diff)
downloadleg-kernel-0d2d2a67c95fd4304dd00b935a6695131e9ab12b.tar.gz
serial: 8250_hisi_lpc: fix panic without lpc node
When 8250_hisi_lpc enabled, but without relevant node in DT or ACPI, the iobase in struct uart_port is not initialized, so io_serial_out will fail and lead to panic. Fix this by check whether arm64_isa_pio is set or not, and only enable HISILICON_LPC in arm64. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_hisi_lpc.c')
-rw-r--r--drivers/tty/serial/8250/8250_hisi_lpc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_hisi_lpc.c b/drivers/tty/serial/8250/8250_hisi_lpc.c
index ff6e883e9bf4..eb596a484572 100644
--- a/drivers/tty/serial/8250/8250_hisi_lpc.c
+++ b/drivers/tty/serial/8250/8250_hisi_lpc.c
@@ -273,6 +273,11 @@ static struct platform_device hisi_lpc_uart = {
static int __init hisi_lpc_uart_init(void)
{
+ if (!arm64_isa_pio) {
+ pr_warn("no indirect ISA port I/O for Hisilicon LPC uart");
+ return -EINVAL;
+ }
+
return platform_device_register(&hisi_lpc_uart);
}