net: phy: fixed: allow setting no update_link callback
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 21 Jan 2015 00:41:59 +0000 (16:41 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Jan 2015 00:02:13 +0000 (16:02 -0800)
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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/fixed_phy.c

index 3ad0e6e16c395e61c0f31bd9ab6b30b3fb6adf4e..a08a3c78ba97b08fb503bace451a3d177fc04053 100644 (file)
@@ -168,7 +168,7 @@ int fixed_phy_set_link_update(struct phy_device *phydev,
        struct fixed_mdio_bus *fmb = &platform_fmb;
        struct fixed_phy *fp;
 
-       if (!link_update || !phydev || !phydev->bus)
+       if (!phydev || !phydev->bus)
                return -EINVAL;
 
        list_for_each_entry(fp, &fmb->phys, node) {