From: Chunyan Zhang Date: Wed, 18 Mar 2020 10:50:49 +0000 (+0800) Subject: serial: sprd: remove redundant sprd_port cleanup X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=72534077475fc489f8358c0e214cc1a4d658c8c2;p=linux.git serial: sprd: remove redundant sprd_port cleanup We don't need to cleanup sprd_port anymore, since we've dropped the way of using the sprd_port[] array to get port index. Reviewed-by: Baolin Wang Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20200318105049.19623-3-zhang.lyra@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 23baf8cf1a3b3..9a7ae6384edfa 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1236,10 +1236,8 @@ static int sprd_probe(struct platform_device *pdev) sprd_ports_num++; ret = uart_add_one_port(&sprd_uart_driver, up); - if (ret) { - sprd_port[index] = NULL; + if (ret) sprd_remove(pdev); - } platform_set_drvdata(pdev, up);