Skip to content

Commit

Permalink
net: phy: smsc: use phy_set_bits in smsc_phy_config_init
Browse files Browse the repository at this point in the history
Simplify the code by using phy_set_bits().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/b64d9f86-d029-b911-bbe9-6ca6889399d7@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Heiner Kallweit authored and Jakub Kicinski committed Mar 10, 2023
1 parent 6978052 commit 513bdd9
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/net/phy/smsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,13 @@ static irqreturn_t smsc_phy_handle_interrupt(struct phy_device *phydev)
static int smsc_phy_config_init(struct phy_device *phydev)
{
struct smsc_phy_priv *priv = phydev->priv;
int rc;

if (!priv->energy_enable || phydev->irq != PHY_POLL)
return 0;

rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);

if (rc < 0)
return rc;

/* Enable energy detect mode for this SMSC Transceivers */
rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
rc | MII_LAN83C185_EDPWRDOWN);
return rc;
/* Enable energy detect power down mode */
return phy_set_bits(phydev, MII_LAN83C185_CTRL_STATUS,
MII_LAN83C185_EDPWRDOWN);
}

static int smsc_phy_reset(struct phy_device *phydev)
Expand Down

0 comments on commit 513bdd9

Please sign in to comment.