@@ -380,31 +380,26 @@ static int dp83822_config_init(struct phy_device *phydev)
{
struct dp83822_private *dp83822 = phydev->priv;
struct device *dev = &phydev->mdio.dev;
- int rgmii_delay;
- s32 rx_int_delay;
- s32 tx_int_delay;
+ int value = 0;
+ s32 trx_int_delay;
int err = 0;
int bmcr;
if (phy_interface_is_rgmii(phydev)) {
- rx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
+ trx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
true);
- if (rx_int_delay <= 0)
- rgmii_delay = 0;
- else
- rgmii_delay = DP83822_RX_CLK_SHIFT;
+ if (trx_int_delay > 0)
+ value = DP83822_RX_CLK_SHIFT;
- tx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
+ trx_int_delay = phy_get_internal_delay(phydev, dev, NULL, 0,
false);
- if (tx_int_delay <= 0)
- rgmii_delay &= ~DP83822_TX_CLK_SHIFT;
- else
- rgmii_delay |= DP83822_TX_CLK_SHIFT;
+ if (trx_int_delay > 0)
+ value |= DP83822_TX_CLK_SHIFT;
- if (rgmii_delay) {
+ if (value) {
err = phy_set_bits_mmd(phydev, DP83822_DEVADDR,
- MII_DP83822_RCSR, rgmii_delay);
+ MII_DP83822_RCSR, value);
if (err)
return err;
}
Rename some variables and reduce a bit code complexity. No functional changes Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> --- drivers/net/phy/dp83822.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-)