diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-29 17:15:01 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-29 17:17:01 +0200 |
commit | ab8e23f239ddda7fff4d9a12a9d856d346e0d553 (patch) | |
tree | e333d5aace78be47116a3e4b4055823707c2ba0d /drivers | |
parent | 65681ac20165ae709c52bda26ed9c32f4aeff0dd (diff) | |
download | barebox-ab8e23f239ddda7fff4d9a12a9d856d346e0d553.tar.gz barebox-ab8e23f239ddda7fff4d9a12a9d856d346e0d553.tar.xz |
net: phy: at803x: Use genphy_config_init
Based on the Linux commit:
6ff01db net: phy: at803x: use genphy_config_init()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/at803x.c | 36 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 3 |
2 files changed, 4 insertions, 35 deletions
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index a244c87cba..de5bf200c9 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -33,41 +33,11 @@ static int at803x_config_init(struct phy_device *phydev) { - int val; int ret; - u32 features; - features = SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_AUI | - SUPPORTED_FIBRE | SUPPORTED_BNC; - - val = phy_read(phydev, MII_BMSR); - if (val < 0) - return val; - - if (val & BMSR_ANEGCAPABLE) - features |= SUPPORTED_Autoneg; - if (val & BMSR_100FULL) - features |= SUPPORTED_100baseT_Full; - if (val & BMSR_100HALF) - features |= SUPPORTED_100baseT_Half; - if (val & BMSR_10FULL) - features |= SUPPORTED_10baseT_Full; - if (val & BMSR_10HALF) - features |= SUPPORTED_10baseT_Half; - - if (val & BMSR_ESTATEN) { - val = phy_read(phydev, MII_ESTATUS); - if (val < 0) - return val; - - if (val & ESTATUS_1000_TFULL) - features |= SUPPORTED_1000baseT_Full; - if (val & ESTATUS_1000_THALF) - features |= SUPPORTED_1000baseT_Half; - } - - phydev->supported = features; - phydev->advertising = features; + ret = genphy_config_init(phydev); + if (ret < 0) + return ret; if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { ret = phy_write(phydev, AT803X_DEBUG_ADDR, diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index edf5d03d94..2b3c5e2e02 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -29,7 +29,6 @@ #define PHY_AN_TIMEOUT 10 static struct phy_driver genphy_driver; -static int genphy_config_init(struct phy_device *phydev); /** * phy_aneg_done - return auto-negotiation status @@ -806,7 +805,7 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad, phy_write(phydev, MII_MMD_DATA, data); } -static int genphy_config_init(struct phy_device *phydev) +int genphy_config_init(struct phy_device *phydev) { int val; u32 features; |