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>
This commit is contained in:
committed by
Jakub Kicinski
parent
8718d60ee6
commit
bb7eae6dd2
@@ -252,7 +252,7 @@ int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id)
|
|||||||
|
|
||||||
int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id)
|
int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id)
|
||||||
{
|
{
|
||||||
int err, path = 0;
|
int path = 0;
|
||||||
|
|
||||||
if (mac_id == 1)
|
if (mac_id == 1)
|
||||||
path = MTK_ETH_PATH_GMAC2_GEPHY;
|
path = MTK_ETH_PATH_GMAC2_GEPHY;
|
||||||
@@ -261,25 +261,17 @@ int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Setup proper MUXes along the path */
|
/* Setup proper MUXes along the path */
|
||||||
err = mtk_eth_mux_setup(eth, path);
|
return mtk_eth_mux_setup(eth, path);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id)
|
int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id)
|
||||||
{
|
{
|
||||||
int err, path;
|
int path;
|
||||||
|
|
||||||
path = (mac_id == 0) ? MTK_ETH_PATH_GMAC1_RGMII :
|
path = (mac_id == 0) ? MTK_ETH_PATH_GMAC1_RGMII :
|
||||||
MTK_ETH_PATH_GMAC2_RGMII;
|
MTK_ETH_PATH_GMAC2_RGMII;
|
||||||
|
|
||||||
/* Setup proper MUXes along the path */
|
/* Setup proper MUXes along the path */
|
||||||
err = mtk_eth_mux_setup(eth, path);
|
return mtk_eth_mux_setup(eth, path);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user