devm_mdiobus_alloc_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the mii_bus for. 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_bus on success πŸ”₯
  • NULL on out-of-memory error 😭 (yeah, check it. please check it.)

🧚 SEE ALSO 🧚


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