devm_mdiobus_alloc_size(9)
π devm_mdiobus_alloc_size(9) π
okay so bestie, welcome to the Kernel API Manual β yes this is literally the devm_mdiobus_alloc_size(9) page and it's giving "tiny function, big responsibility" energy. let's get into it π
β¨ NAME β¨
devm_mdiobus_alloc_size β the resource-managed glow-up of mdiobus_alloc_size(). same girl, but now she cleans up after herself π«Ά
πΈ SYNOPSIS πΈ
struct mii_bus * devm_mdiobus_alloc_size (struct device *dev , int sizeof_priv );
that's the whole vibe: you hand her a dev, you hand her a size, she hands you back a struct mii_bus *. slay β¨
π¦ ARGUMENTS π¦
devβ the device you're allocating themii_busfor. main character energy, everything hangs off this one πsizeof_privβ the space to allocate for your private structure. lowkey the extra room in the back of the bus, iykyk π
π DESCRIPTION π
so it's a managed mdiobus_alloc_size. the mii_bus you allocate with this function gets automatically freed on driver detach β like, you don't have to do anything, it's handled, no cap π
literally the whole point: allocate now, forget later, the kernel remembers for you. it's giving "she's so organized" π
β RETURN β
- pointer to the allocated
mii_buson success π₯ NULLon out-of-memory error π (yeah, check it. please check it.)
π§ SEE ALSO π§
- Kernel file
./drivers/net/phy/mdio_devres.cπ __devm_mdiobus_register(9)__devm_of_mdiobus_register(9)
ok that's the whole page bestie, go forth and allocate responsibly π
sign-off szn: this little icon lives at ./drivers/net/phy, dated October 2026, and it's filed under devm_mdiobus_alloc_size(9) β periodt πβ¨
π¦ 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