mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 18:43:33 +02:00
net: phy: use new iterator mdiobus_for_each_phy in mdiobus_prevent_c45_scan
Use new iterator mdiobus_for_each_phy() to simplify the code. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/6d792b1e-d23d-4b7e-a94f-89c6617b620f@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
4575875065
commit
d4780abb8c
|
|
@ -249,20 +249,15 @@ static int mdiobus_scan_bus_c45(struct mii_bus *bus)
|
|||
*/
|
||||
static bool mdiobus_prevent_c45_scan(struct mii_bus *bus)
|
||||
{
|
||||
int i;
|
||||
struct phy_device *phydev;
|
||||
|
||||
for (i = 0; i < PHY_MAX_ADDR; i++) {
|
||||
struct phy_device *phydev;
|
||||
u32 oui;
|
||||
|
||||
phydev = mdiobus_get_phy(bus, i);
|
||||
if (!phydev)
|
||||
continue;
|
||||
oui = phydev->phy_id >> 10;
|
||||
mdiobus_for_each_phy(bus, phydev) {
|
||||
u32 oui = phydev->phy_id >> 10;
|
||||
|
||||
if (oui == MICREL_OUI)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user