Message ID | 65a41b61-1122-49cb-805c-cf2cfe636b72@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] r8169: don't scan PHY addresses > 0 | expand |
On Mon, Feb 03, 2025 at 09:48:00PM +0100, Heiner Kallweit wrote: > The PHY address is a dummy anyway, because r8169 PHY access registers > don't support a PHY address. Therefore scan address 0 only, this saves > some cpu cycles and allows to remove two checks. The IOCTL interface allows you to access any address on the bus. So you should probably keep the tests. Setting phy_mask however is a good idea. Andrew
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 5a5eba49c..a65a6cbe9 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -5180,9 +5180,6 @@ static int r8169_mdio_read_reg(struct mii_bus *mii_bus, int phyaddr, int phyreg) { struct rtl8169_private *tp = mii_bus->priv; - if (phyaddr > 0) - return -ENODEV; - return rtl_readphy(tp, phyreg); } @@ -5191,9 +5188,6 @@ static int r8169_mdio_write_reg(struct mii_bus *mii_bus, int phyaddr, { struct rtl8169_private *tp = mii_bus->priv; - if (phyaddr > 0) - return -ENODEV; - rtl_writephy(tp, phyreg, val); return 0; @@ -5222,6 +5216,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp) new_bus->priv = tp; new_bus->parent = &pdev->dev; new_bus->irq[0] = PHY_MAC_INTERRUPT; + new_bus->phy_mask = GENMASK(31, 1); snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x-%x", pci_domain_nr(pdev->bus), pci_dev_id(pdev));
The PHY address is a dummy anyway, because r8169 PHY access registers don't support a PHY address. Therefore scan address 0 only, this saves some cpu cycles and allows to remove two checks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/ethernet/realtek/r8169_main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)