Skip to content

Commit b1f01b4

Browse files
l1kkuba-moo
authored andcommitted
net: phy: smsc: Deduplicate interrupt acknowledgement upon phy_init_hw()
Since commit 4c0d2e9 ("net: phy: consider that suspend2ram may cut off PHY power"), phy_init_hw() invokes both, the ->config_init() and ->config_intr() callbacks. In the SMSC PHY driver, the latter acknowledges stale interrupts, hence there's no longer a need to acknowledge them in the former as well. There are no other callers of ->config_init() besides phy_init_hw(). Drop the redundant code. Signed-off-by: Lukas Wunner <[email protected]> Link: https://lore.kernel.org/r/0254edf48bddc96c6248c4414043a3699e94614a.1655716767.git.lukas@wunner.de Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8720bd9 commit b1f01b4

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/net/phy/smsc.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ static int smsc_phy_config_init(struct phy_device *phydev)
121121
/* Enable energy detect mode for this SMSC Transceivers */
122122
rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
123123
rc | MII_LAN83C185_EDPWRDOWN);
124-
if (rc < 0)
125-
return rc;
126-
127-
return smsc_phy_ack_interrupt(phydev);
124+
return rc;
128125
}
129126

130127
static int smsc_phy_reset(struct phy_device *phydev)
@@ -146,11 +143,6 @@ static int smsc_phy_reset(struct phy_device *phydev)
146143
return genphy_soft_reset(phydev);
147144
}
148145

149-
static int lan911x_config_init(struct phy_device *phydev)
150-
{
151-
return smsc_phy_ack_interrupt(phydev);
152-
}
153-
154146
static int lan87xx_config_aneg(struct phy_device *phydev)
155147
{
156148
int rc;
@@ -418,9 +410,6 @@ static struct phy_driver smsc_phy_driver[] = {
418410

419411
.probe = smsc_phy_probe,
420412

421-
/* basic functions */
422-
.config_init = lan911x_config_init,
423-
424413
/* IRQ related */
425414
.config_intr = smsc_phy_config_intr,
426415
.handle_interrupt = smsc_phy_handle_interrupt,

0 commit comments

Comments
 (0)