mdio_find_bus(9)
π 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 embeddedstruct devicewill have its reference count incremented. that means you gottaput_devicedit 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:
mdiobus_release(9)mdio_bus_match(9)mdiobus_alloc_size(9)mdiobus_scan_c22(9)mdiobus_scan_c45(9)__mdiobus_register(9)mdiobus_free(9)of_mdio_find_bus(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms