Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Tang Bin and committed by
Greg Kroah-Hartman
fa934fc1 bd5305dc

+1 -5
+1 -5
drivers/tty/serial/fsl_linflexuart.c
··· 861 861 862 862 platform_set_drvdata(pdev, sport); 863 863 864 - ret = uart_add_one_port(&linflex_reg, sport); 865 - if (ret) 866 - return ret; 867 - 868 - return 0; 864 + return uart_add_one_port(&linflex_reg, sport); 869 865 } 870 866 871 867 static int linflex_remove(struct platform_device *pdev)