of_mdio_find_bus(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– of_mdio_find_bus(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for of_mdio_find_bus. this is the one where you hand over an mii_bus node and she finds the mii_bus for you. slay. ✨


πŸŽ€ NAME πŸŽ€

of_mdio_find_bus β€” Given an mii_bus node, find the mii_bus.

🌸 SYNOPSIS 🌸

struct mii_bus * of_mdio_find_bus (struct device_node *mdio_bus_np );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • mdio_bus_np β€” Pointer to the mii_bus. that's it, that's the argument. πŸ’…

⭐ RETURN ⭐

a reference to the mii_bus, or NULL if none found. The embedded struct device will have its reference count incremented, and this must be put once the bus is finished with.

🫢 real talk: that reference count bump is not decorative β€” you gotta put it when you're done with the bus. periodt.

πŸ”₯ DESCRIPTION πŸ”₯

Because the association of a device_node and mii_bus is made via of_mdiobus_register, the mii_bus cannot be found before it is registered with of_mdiobus_register.

like, she doesn't exist to this lookup until of_mdiobus_register has made the association. so don't come looking early β€” the vibe check will fail. 😭

🧚 SEE ALSO 🧚

Kernel file ./drivers/net/phy/mdio_bus_provider.c β€” and the whole bestie lineup:


source/version: ./drivers/net/phy β€’ date: October 2026 β€’ page: of_mdio_find_bus(9) β€” mwah, bye bestie! πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from