mdio_find_bus(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mdio_find_bus(9) πŸ’–

okay so bestie, welcome to the mdio_find_bus page β€” this is a kernel API manual entry, and we're gonna get you comfy with it in like two minutes flat. no cap.


πŸŽ€ NAME πŸŽ€

mdio_find_bus β€” give it the name of a mdiobus and it finds you the mii_bus. that's the whole vibe. it's giving "search bar for buses" ✨


🌸 SYNOPSIS 🌸

struct mii_bus * mdio_find_bus (const char *mdio_name );

like, that's it. one call, one arg, one pointer back. iconic behavior honestly πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mdio_name β€” the name of a mdiobus. yes, that's the actual name. it's literally a string with the bus name in it. you pass it in, the function goes looking. πŸ•΅οΈβ€β™€οΈ

πŸ‘‘ RETURN πŸ‘‘

so here's what you get back:

  • a reference to the mii_bus β€” slay, you found it πŸŽ‰
  • NULL β€” if none found. sad girl hours, the bus doesn't exist 😭
⚠️ important, don't skip this part bestie: when you DO get a bus back, the embedded struct device will have its reference count incremented. that means you gotta put_deviced it once the bus is finished with. fr fr, do not forget β€” this is the kind of thing that comes back to haunt you 🫢

🌈 SEE ALSO 🌈

the whole friend group, in kernel file ./drivers/net/phy/mdio_bus_provider.c:

iykyk β€” go read them all, they're all bangers πŸ’œ


mwah, that's the page! πŸ“ this one lives in the kernel source tree at ./drivers/net/phy, and it's dated October 2026. take care of your refcounts and you'll be fine. byeeeee πŸ’–βœ¨

πŸ“¦ where this page comes from