Commit 9042b46e authored by Jerome Brunet's avatar Jerome Brunet Committed by David S. Miller

net: phy: meson-gxl: check phy_write return value

Always check phy_write return values. Better to be safe than sorry
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7655085
...@@ -26,27 +26,53 @@ ...@@ -26,27 +26,53 @@
static int meson_gxl_config_init(struct phy_device *phydev) static int meson_gxl_config_init(struct phy_device *phydev)
{ {
int ret;
/* Enable Analog and DSP register Bank access by */ /* Enable Analog and DSP register Bank access by */
phy_write(phydev, 0x14, 0x0000); ret = phy_write(phydev, 0x14, 0x0000);
phy_write(phydev, 0x14, 0x0400); if (ret)
phy_write(phydev, 0x14, 0x0000); return ret;
phy_write(phydev, 0x14, 0x0400); ret = phy_write(phydev, 0x14, 0x0400);
if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x0000);
if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x0400);
if (ret)
return ret;
/* Write Analog register 23 */ /* Write Analog register 23 */
phy_write(phydev, 0x17, 0x8E0D); ret = phy_write(phydev, 0x17, 0x8E0D);
phy_write(phydev, 0x14, 0x4417); if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x4417);
if (ret)
return ret;
/* Enable fractional PLL */ /* Enable fractional PLL */
phy_write(phydev, 0x17, 0x0005); ret = phy_write(phydev, 0x17, 0x0005);
phy_write(phydev, 0x14, 0x5C1B); if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x5C1B);
if (ret)
return ret;
/* Program fraction FR_PLL_DIV1 */ /* Program fraction FR_PLL_DIV1 */
phy_write(phydev, 0x17, 0x029A); ret = phy_write(phydev, 0x17, 0x029A);
phy_write(phydev, 0x14, 0x5C1D); if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x5C1D);
if (ret)
return ret;
/* Program fraction FR_PLL_DIV1 */ /* Program fraction FR_PLL_DIV1 */
phy_write(phydev, 0x17, 0xAAAA); ret = phy_write(phydev, 0x17, 0xAAAA);
phy_write(phydev, 0x14, 0x5C1C); if (ret)
return ret;
ret = phy_write(phydev, 0x14, 0x5C1C);
if (ret)
return ret;
return 0; return 0;
} }
......
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