]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: phy: expose phy_aneg_done API for use by drivers
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Thu, 10 Nov 2016 23:10:46 +0000 (17:10 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 13 Nov 2016 05:56:26 +0000 (00:56 -0500)
Make phy_aneg_done() available to drivers so that the result of the
auto-negotiation initiated by phy_start_aneg() can be determined.

Remove the local implementation of phy_aneg_done() from the Aeroflex
driver and use the phy library version.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aeroflex/greth.c
drivers/net/phy/phy.c
include/linux/phy.h

index f8df8248035ec8f6ba7f14aab225b6e7cb3dba64..93def92f999703d234b44508725f45863ef39a18 100644 (file)
@@ -1290,15 +1290,6 @@ static int greth_mdio_probe(struct net_device *dev)
        return 0;
 }
 
-static inline int phy_aneg_done(struct phy_device *phydev)
-{
-       int retval;
-
-       retval = phy_read(phydev, MII_BMSR);
-
-       return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
-}
-
 static int greth_mdio_init(struct greth_private *greth)
 {
        int ret;
index 2f94c60d49394ecc743b13660a261979c460c15b..e6dd222fddb15c5c6ffecf016f4b544823a90319 100644 (file)
@@ -143,13 +143,14 @@ static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
  * Returns > 0 on success or < 0 on error. 0 means that auto-negotiation
  * is still pending.
  */
-static inline int phy_aneg_done(struct phy_device *phydev)
+int phy_aneg_done(struct phy_device *phydev)
 {
        if (phydev->drv->aneg_done)
                return phydev->drv->aneg_done(phydev);
 
        return genphy_aneg_done(phydev);
 }
+EXPORT_SYMBOL(phy_aneg_done);
 
 /* A structure for mapping a particular speed and duplex
  * combination to a particular SUPPORTED and ADVERTISED value
index e7e1fd3825646090ee3e4eeaae13d3f43d3cf2f2..9880d73a2c3d6340717bd2a56bbb253d9ecb0218 100644 (file)
@@ -786,6 +786,7 @@ void phy_detach(struct phy_device *phydev);
 void phy_start(struct phy_device *phydev);
 void phy_stop(struct phy_device *phydev);
 int phy_start_aneg(struct phy_device *phydev);
+int phy_aneg_done(struct phy_device *phydev);
 
 int phy_stop_interrupts(struct phy_device *phydev);