Commit 799d4444 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: phy: fixed: allow setting no update_link callback

fixed_phy_set_link_update() contains an early check against a NULL
callback pointer, which basically prevents us from removing any
previous callback we may have set. The users of the fp->link_update
callback deal with a NULL callback just fine, so we really want to allow
"removing" a link_update callback to avoid dangling callback pointers
during e.g: module removal.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c2943f14
...@@ -168,7 +168,7 @@ int fixed_phy_set_link_update(struct phy_device *phydev, ...@@ -168,7 +168,7 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
struct fixed_mdio_bus *fmb = &platform_fmb; struct fixed_mdio_bus *fmb = &platform_fmb;
struct fixed_phy *fp; struct fixed_phy *fp;
if (!link_update || !phydev || !phydev->bus) if (!phydev || !phydev->bus)
return -EINVAL; return -EINVAL;
list_for_each_entry(fp, &fmb->phys, node) { list_for_each_entry(fp, &fmb->phys, node) {
......
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