net: phy: modify assignment to OR for dev_flags in phy_attach_direct
authorTao Ren <taoren@fb.com>
Tue, 22 Oct 2019 18:31:06 +0000 (11:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Oct 2019 03:42:52 +0000 (20:42 -0700)
Modify the assignment to OR when dealing with phydev->dev_flags in
phy_attach_direct function, and this is to make sure dev_flags set in
driver's probe callback won't be lost.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
CC: Heiner Kallweit <hkallweit1@gmail.com>
CC: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Tao Ren <taoren@fb.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index adb66a2..f1f60bd 100644 (file)
@@ -1270,7 +1270,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
                        phydev_err(phydev, "error creating 'phy_standalone' sysfs entry\n");
        }
 
-       phydev->dev_flags = flags;
+       phydev->dev_flags |= flags;
 
        phydev->interface = interface;