Commit 57738dd2 authored by Moritz Fischer's avatar Moritz Fischer Committed by Greg Kroah-Hartman

net: phy: fixed_phy: Fix fixed_phy not checking GPIO

[ Upstream commit 8f289805 ]

Fix fixed_phy not checking GPIO if no link_update callback
is registered.

In the original version all users registered a link_update
callback so the issue was masked.

Fixes: a5597008 ("phy: fixed_phy: Add gpio to determine link up/down.")
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarMoritz Fischer <mdf@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0cef474e
...@@ -67,11 +67,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num) ...@@ -67,11 +67,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
do { do {
s = read_seqcount_begin(&fp->seqcount); s = read_seqcount_begin(&fp->seqcount);
/* Issue callback if user registered it. */ /* Issue callback if user registered it. */
if (fp->link_update) { if (fp->link_update)
fp->link_update(fp->phydev->attached_dev, fp->link_update(fp->phydev->attached_dev,
&fp->status); &fp->status);
fixed_phy_update(fp); /* Check the GPIO for change in status */
} fixed_phy_update(fp);
state = fp->status; state = fp->status;
} while (read_seqcount_retry(&fp->seqcount, s)); } while (read_seqcount_retry(&fp->seqcount, s));
......
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