quoted
+ phydev->irq = dev->mdiobus->irq[phydev->mdio.addr];
This line is redundant, given how phylib works.
It is once the table is filled before the bus is registered, and here
it is not yet: this patch writes the table in lan78xx_phy_init(), after
the scan, so phy_device_create() had already seeded phydev->irq from a
table that still read PHY_POLL.
The number is known before the bus exists, lan78xx_setup_irq_domain()
runs ahead of lan78xx_mdio_init(), so v9 fills the table there, before
of_mdiobus_register(), and drops this assignment together with the
if/else above it. On a 7801 the PHY address is not known until the scan,
so every entry gets the number, the way mdio-moxart does it. A
devicetree mdio node still wins: fwnode_mdio writes both fields after
the device is created.
quoted
netdev_dbg(dev->net, "phydev->irq = %d\n", phydev->irq);
So maybe change this line?
It goes too. phy_attached_print() reports the irq at connect.