From: Tang Bin Date: Mon, 23 Aug 2021 11:07:54 +0000 (+0800) Subject: tty: serial: linflexuart: Remove redundant check to simplify the code X-Git-Tag: v5.15-rc1~153^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fa934fc1a8679f0704dddaefb6946c3da26c58a5;p=thirdparty%2Fkernel%2Flinux.git tty: serial: linflexuart: Remove redundant check to simplify the code In the function uart_add_one_port(), it can return zero or non-zero, so remove redundant check to simplify the code. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20210823110754.11232-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c index d87048073abe7..2837572646084 100644 --- a/drivers/tty/serial/fsl_linflexuart.c +++ b/drivers/tty/serial/fsl_linflexuart.c @@ -861,11 +861,7 @@ static int linflex_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sport); - ret = uart_add_one_port(&linflex_reg, sport); - if (ret) - return ret; - - return 0; + return uart_add_one_port(&linflex_reg, sport); } static int linflex_remove(struct platform_device *pdev)