Skip to content

Commit

Permalink
net: phy: fixed_phy: Fix fixed_phy not checking GPIO
Browse files Browse the repository at this point in the history
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: a559700 ("phy: fixed_phy: Add gpio to determine link up/down.")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Moritz Fischer authored and David S. Miller committed Feb 7, 2019
1 parent 22087d6 commit 8f28980
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/phy/fixed_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
s = read_seqcount_begin(&fp->seqcount);
fp->status.link = !fp->no_carrier;
/* Issue callback if user registered it. */
if (fp->link_update) {
if (fp->link_update)
fp->link_update(fp->phydev->attached_dev,
&fp->status);
fixed_phy_update(fp);
}
/* Check the GPIO for change in status */
fixed_phy_update(fp);
state = fp->status;
} while (read_seqcount_retry(&fp->seqcount, s));

Expand Down

0 comments on commit 8f28980

Please sign in to comment.