]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
tty: serial: linflexuart: Remove redundant check to simplify the code
authorTang Bin <tangbin@cmss.chinamobile.com>
Mon, 23 Aug 2021 11:07:54 +0000 (19:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 12:51:04 +0000 (14:51 +0200)
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 <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210823110754.11232-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_linflexuart.c

index d87048073abe751e0c75ad7f7a3ca2df43b86f6d..28375726460845938cd6b7df0c62783c3db580fd 100644 (file)
@@ -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)