Commit 5cf77975 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: mtk_eth_soc: eliminate unnecessary error handling

The functions called by the pcs_config() method always return zero, so
there is no point trying to handle an error from these functions. Make
these functions void, eliminate the "err" variable and simply return
zero from the pcs_config() function itself.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b6a709cb
...@@ -20,7 +20,7 @@ static struct mtk_pcs *pcs_to_mtk_pcs(struct phylink_pcs *pcs) ...@@ -20,7 +20,7 @@ static struct mtk_pcs *pcs_to_mtk_pcs(struct phylink_pcs *pcs)
} }
/* For SGMII interface mode */ /* For SGMII interface mode */
static int mtk_pcs_setup_mode_an(struct mtk_pcs *mpcs) static void mtk_pcs_setup_mode_an(struct mtk_pcs *mpcs)
{ {
unsigned int val; unsigned int val;
...@@ -39,16 +39,13 @@ static int mtk_pcs_setup_mode_an(struct mtk_pcs *mpcs) ...@@ -39,16 +39,13 @@ static int mtk_pcs_setup_mode_an(struct mtk_pcs *mpcs)
regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val); regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
val &= ~SGMII_PHYA_PWD; val &= ~SGMII_PHYA_PWD;
regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val); regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
return 0;
} }
/* For 1000BASE-X and 2500BASE-X interface modes, which operate at a /* For 1000BASE-X and 2500BASE-X interface modes, which operate at a
* fixed speed. * fixed speed.
*/ */
static int mtk_pcs_setup_mode_force(struct mtk_pcs *mpcs, static void mtk_pcs_setup_mode_force(struct mtk_pcs *mpcs,
phy_interface_t interface) phy_interface_t interface)
{ {
unsigned int val; unsigned int val;
...@@ -73,8 +70,6 @@ static int mtk_pcs_setup_mode_force(struct mtk_pcs *mpcs, ...@@ -73,8 +70,6 @@ static int mtk_pcs_setup_mode_force(struct mtk_pcs *mpcs,
regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val); regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
val &= ~SGMII_PHYA_PWD; val &= ~SGMII_PHYA_PWD;
regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val); regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
return 0;
} }
static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode, static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
...@@ -83,15 +78,14 @@ static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode, ...@@ -83,15 +78,14 @@ static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
bool permit_pause_to_mac) bool permit_pause_to_mac)
{ {
struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs); struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs);
int err = 0;
/* Setup SGMIISYS with the determined property */ /* Setup SGMIISYS with the determined property */
if (interface != PHY_INTERFACE_MODE_SGMII) if (interface != PHY_INTERFACE_MODE_SGMII)
err = mtk_pcs_setup_mode_force(mpcs, interface); mtk_pcs_setup_mode_force(mpcs, interface);
else if (phylink_autoneg_inband(mode)) else if (phylink_autoneg_inband(mode))
err = mtk_pcs_setup_mode_an(mpcs); mtk_pcs_setup_mode_an(mpcs);
return err; return 0;
} }
static void mtk_pcs_restart_an(struct phylink_pcs *pcs) static void mtk_pcs_restart_an(struct phylink_pcs *pcs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment