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

net: mtk_eth: simplify the mediatek code return expression

Simplify the return expression at mtk_eth_path.c file, simplify this all.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20201211083801.1632-1-zhengyongjun3@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Zheng Yongjun and committed by
Jakub Kicinski
bb7eae6d 8718d60e

+4 -12
+4 -12
drivers/net/ethernet/mediatek/mtk_eth_path.c
··· 252 252 253 253 int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id) 254 254 { 255 - int err, path = 0; 255 + int path = 0; 256 256 257 257 if (mac_id == 1) 258 258 path = MTK_ETH_PATH_GMAC2_GEPHY; ··· 261 261 return -EINVAL; 262 262 263 263 /* Setup proper MUXes along the path */ 264 - err = mtk_eth_mux_setup(eth, path); 265 - if (err) 266 - return err; 267 - 268 - return 0; 264 + return mtk_eth_mux_setup(eth, path); 269 265 } 270 266 271 267 int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id) 272 268 { 273 - int err, path; 269 + int path; 274 270 275 271 path = (mac_id == 0) ? MTK_ETH_PATH_GMAC1_RGMII : 276 272 MTK_ETH_PATH_GMAC2_RGMII; 277 273 278 274 /* Setup proper MUXes along the path */ 279 - err = mtk_eth_mux_setup(eth, path); 280 - if (err) 281 - return err; 282 - 283 - return 0; 275 + return mtk_eth_mux_setup(eth, path); 284 276 } 285 277