]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: bcmgenet: Set phydev->dev_flags only for internal PHYs
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 11 Oct 2019 19:53:49 +0000 (12:53 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 17:46:43 +0000 (18:46 +0100)
BugLink: https://bugs.launchpad.net/bugs/1850456
[ Upstream commit 92696286f3bb37ba50e4bd8d1beb24afb759a799 ]

phydev->dev_flags is entirely dependent on the PHY device driver which
is going to be used, setting the internal GENET PHY revision in those
bits only makes sense when drivers/net/phy/bcm7xxx.c is the PHY driver
being used.

Fixes: 487320c54143 ("net: bcmgenet: communicate integrated PHY revision to PHY driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Doug Berger <opendmb@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/broadcom/genet/bcmmii.c

index 37b586b863343a094218ef42455bde0646e1c826..e7c291bf4ed1710ca6859970ee00e914b50cbcf7 100644 (file)
@@ -277,11 +277,12 @@ int bcmgenet_mii_probe(struct net_device *dev)
        struct bcmgenet_priv *priv = netdev_priv(dev);
        struct device_node *dn = priv->pdev->dev.of_node;
        struct phy_device *phydev;
-       u32 phy_flags;
+       u32 phy_flags = 0;
        int ret;
 
        /* Communicate the integrated PHY revision */
-       phy_flags = priv->gphy_rev;
+       if (priv->internal_phy)
+               phy_flags = priv->gphy_rev;
 
        /* Initialize link state variables that bcmgenet_mii_setup() uses */
        priv->old_link = -1;