[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200419082757.5650-1-michael@walle.cc>
Date: Sun, 19 Apr 2020 10:27:57 +0200
From: Michael Walle <michael@...le.cc>
To: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S . Miller" <davem@...emloft.net>,
Vladimir Oltean <vladimir.oltean@....com>,
Michael Walle <michael@...le.cc>
Subject: [PATCH net-next] net: phy: mscc: use mdiobus_get_phy()
Don't use internal knowledge of the mdio bus core, instead use
mdiobus_get_phy() which does the same thing.
Signed-off-by: Michael Walle <michael@...le.cc>
---
drivers/net/phy/mscc/mscc_main.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
index acddef79f4e8..5391acdece05 100644
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -1292,7 +1292,7 @@ static int vsc8584_config_pre_init(struct phy_device *phydev)
*/
static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed)
{
- struct mdio_device **map = phydev->mdio.bus->mdio_map;
+ struct mii_bus *bus = phydev->mdio.bus;
struct vsc8531_private *vsc8531;
struct phy_device *phy;
int i, addr;
@@ -1306,11 +1306,10 @@ static bool vsc8584_is_pkg_init(struct phy_device *phydev, bool reversed)
else
addr = vsc8531->base_addr + i;
- if (!map[addr])
+ phy = mdiobus_get_phy(bus, addr);
+ if (!phy)
continue;
- phy = container_of(map[addr], struct phy_device, mdio);
-
if ((phy->phy_id & phydev->drv->phy_id_mask) !=
(phydev->drv->phy_id & phydev->drv->phy_id_mask))
continue;
--
2.20.1
Powered by blists - more mailing lists