summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-21 13:38:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-23 15:40:51 +0200
commit1607f679dab49bf5434f0e758247feaca92a50d5 (patch)
treeef6199f6cac70ba099c5eb3b2c876731cca88bf6 /drivers
parente2eb6e50f45ef078a6bda48acb3aea4b63e49237 (diff)
downloadbarebox-1607f679dab49bf5434f0e758247feaca92a50d5.tar.gz
barebox-1607f679dab49bf5434f0e758247feaca92a50d5.tar.xz
net: phy: genphy: Make it work with of_set_phy_supported
phys start with features initialized from the phy driver and are eventually limited by of_set_phy_supported. This does not work with the genphy driver which starts with no features and overwrites phydev->supported with the values read from hardware in config_init. This overwrites the features adjusted by of_set_phy_supported. To fix this let the genphy driver start with full features which are then only limited in config_init, but never extended. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/phy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e214c13210..517ed583bf 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -805,8 +805,8 @@ static int genphy_config_init(struct phy_device *phydev)
features |= SUPPORTED_1000baseT_Half;
}
- phydev->supported = features;
- phydev->advertising = features;
+ phydev->supported &= features;
+ phydev->advertising &= features;
return 0;
}
@@ -858,7 +858,9 @@ static struct phy_driver genphy_driver = {
.drv.name = "Generic PHY",
.phy_id = PHY_ANY_UID,
.phy_id_mask = PHY_ANY_UID,
- .features = 0,
+ .features = PHY_GBIT_FEATURES | SUPPORTED_MII |
+ SUPPORTED_AUI | SUPPORTED_FIBRE |
+ SUPPORTED_BNC,
};
static int generic_phy_register(void)