Commit 58673d10 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-phy-adin1100-fix-powerdown-mode-setting'

Alexander Dahl says:

====================
net: phy: adin1100: Fix powerdown mode setting

while building a new device around the ADIN1100 I noticed some errors in
kernel log when calling `ifdown` on the ethernet device.  Series has a
straight forward fix and an obvious follow-up code simplification.
====================

Link: https://patch.msgid.link/20251119124737.280939-1-ada@thorsis.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 22eaa206 5894cab4
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -192,16 +192,15 @@ static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev)
static int adin_set_powerdown_mode(struct phy_device *phydev, bool en)
{
	int ret;
	int val;

	val = en ? ADIN_CRSM_SFT_PD_CNTRL_EN : 0;
	ret = phy_write_mmd(phydev, MDIO_MMD_VEND1,
			    ADIN_CRSM_SFT_PD_CNTRL, val);
			    ADIN_CRSM_SFT_PD_CNTRL,
			    en ? ADIN_CRSM_SFT_PD_CNTRL_EN : 0);
	if (ret < 0)
		return ret;

	return phy_read_mmd_poll_timeout(phydev, MDIO_MMD_VEND1, ADIN_CRSM_STAT, ret,
					 (ret & ADIN_CRSM_SFT_PD_RDY) == val,
					 !!(ret & ADIN_CRSM_SFT_PD_RDY) == en,
					 1000, 30000, true);
}