Skip to content

Commit

Permalink
net: of_mdio: fix of_set_phy_supported after driver probing
Browse files Browse the repository at this point in the history
Commit 8fdade4 ("net: of_mdio: parse "max-speed" property to set PHY
supported features") introduced a typo in of_set_phy_supported for the
first assignment of phydev->supported which will not effectively limit
the PHY device supported features bits if the PHY driver contains
"higher" features (e.g: max-speed = <100> and PHY driver has
PHY_GBIT_FEATURES set).

Fix this by making sure that the very first thing is to reset to sane
defaults (PHY_BASIC_FEATURES) and then progressively add speed features
as we parse them.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Feb 14, 2014
1 parent d43ff4c commit ce11c43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/of/of_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ MODULE_LICENSE("GPL");

static void of_set_phy_supported(struct phy_device *phydev, u32 max_speed)
{
phydev->supported |= PHY_DEFAULT_FEATURES;
/* The default values for phydev->supported are provided by the PHY
* driver "features" member, we want to reset to sane defaults fist
* before supporting higher speeds.
*/
phydev->supported &= PHY_DEFAULT_FEATURES;

switch (max_speed) {
default:
Expand Down

0 comments on commit ce11c43

Please sign in to comment.