Re: [PATCH net-next 3/5] net: phy: Add support for the ADIN1140 PHY
From: Andrew Lunn
Date: Sat May 02 2026 - 20:41:28 EST
> +static int adin1140_phy_read_mmd(struct phy_device *phydev, int devnum,
> + u16 regnum)
> +{
> + struct mii_bus *bus = phydev->mdio.bus;
> + int addr = phydev->mdio.addr;
> +
> + return __mdiobus_c45_read(bus, addr, devnum, regnum);
> +}
> +
> +static int adin1140_phy_write_mmd(struct phy_device *phydev, int devnum,
> + u16 regnum, u16 val)
> +{
> + struct mii_bus *bus = phydev->mdio.bus;
> + int addr = phydev->mdio.addr;
> +
> + return __mdiobus_c45_write(bus, addr, devnum, regnum, val);
> +}
Why do these exist?
> +static int adin1140_config_init(struct phy_device *phydev)
> +{
> + /* The link status of the PHY doesn't need to be polled, because
> + * the device doesn't implement AN and there is no other mechanism
> + * to report the link state.
> + */
> + phydev->irq = PHY_MAC_INTERRUPT;
I would prefer you don't abuse this.
> +static int adin1140_read_status(struct phy_device *phydev)
> +{
> + phydev->link = 1;
> + phydev->duplex = DUPLEX_HALF;
> + phydev->speed = SPEED_10;
> + phydev->autoneg = AUTONEG_DISABLE;
> +
> + return 0;
> +}
This should have no really cost, so just let phylib poll.
Andrew