add_disk_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… add_disk_fwnode(9)

okay so bestie, welcome to the Kernel API Manual ✨ β€” section 9, the one where we talk about kernel functions. this page is literally about add_disk_fwnode, and it's honestly not that deep, so let's get into it πŸŽ€

Remember: every detail here is fr fr accurate β€” that's the whole vibe check. πŸ‘‘


🌸 NAME 🌸

add_disk_fwnode β€” the function that adds your disk info to the kernel list, but make it fwnode-flavored πŸ¦‹


✨ SYNOPSIS ✨

int add_disk_fwnode (struct device *parent , struct gendisk *disk ,
       const struct attribute_group **groups , struct fwnode_handle *fwnode );

like, yes, it's a long signature. it's giving "one more parameter, what could go wrong" 😭 but she's worth it.


πŸ’– ARGUMENTS πŸ’–

  • parent β€” the parent device for the disk πŸ‘‘ the main character it answers to
  • disk β€” per-device partitioning information πŸ“ all the partition lore lives here
  • groups β€” additional per-device sysfs groups ✨ extra groups beyond the usual, if you're feeling extra
  • fwnode β€” the attached disk fwnode πŸ”₯ the firmware node getting glued onto this disk

🌈 DESCRIPTION 🌈

so what does she actually do? two things, and they're both lowkey iconic:

this function registers the partitioning information in disk with the kernel πŸ’« and it also attaches a fwnode to the disk device. that's it. that's the whole gig. no cap.


🫢 SEE ALSO 🫢

if you're going down the rabbit hole (and bestie, you are), the kernel file to check is ./block/genhd.c πŸ“ and then there's the whole friend group:

like, the entire block-device squad showed up to the group chat πŸ’€ iykyk.


ngl though, this is one of the chill ones β€” no scary warnings on this page, no deprecated nonsense, no undefined behavior trap. just a clean function doing its job πŸ§šβ€β™€οΈ

and that's a wrap, bestie πŸ’œ this page came out of ./block and it's dated October 2026, and it's filed under add_disk_fwnode(9). periodt. πŸŽ€

πŸ“¦ where this page comes from