add_disk_fwnode(9)
π 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 todiskβ per-device partitioning information π all the partition lore lives heregroupsβ additional per-device sysfs groups β¨ extra groups beyond the usual, if you're feeling extrafwnodeβ 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:
bdev_count_inflight(9)__register_blkdev(9)device_add_disk(9)blk_mark_disk_dead(9)del_gendisk(9)invalidate_disk(9)disk_release(9)put_disk(9)set_disk_ro(9)
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
- 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