platform_device_set_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… platform_device_set_fwnode(9)

okay so bestie, welcome to the Kernel API Manual β€” yes that's the manual name, no it's not a vibe, it's a whole reference library and we're living in it now 🫢


✨ NAME ✨

platform_device_set_fwnode β€” the function that assigns a firmware node to a device, and honestly? it's giving matchmaker energy πŸ”₯


🌸 SYNOPSIS 🌸

void platform_device_set_fwnode (struct platform_device *pdev , struct
       fwnode_handle *fwnode );

like, look at that signature. void return, so it hands you nothing back β€” it just does the thing and dips πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the platform device you're setting the node for. yeah. that one. your fave platform device πŸ’–
  • fwnode β€” the new firmware node you're blessing it with ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the whole point: you assign a firmware node to this platform device. that's it, that's the plot 🎬

but here's the tea β€” internally it keeps track of the reference count for you. like a responsible bestie who remembers who owes whom 🧾

⚠️ big one: devices created with platform_device_alloc must use this function instead of assigning the node manually. no DIY shortcuts, no "I'll just do it myself real quick", none of that. use the function. periodt πŸ‘‘
πŸ’€ also very serious: this function must not be called for a platform device that already has a software node as its primary firmware node assigned. like, don't. it's not a vibe. that's the one rule and we respect it πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./drivers/base/platform.c β€” the source file, the mothership πŸš€ and its whole friend group:


that's the whole page, bestie, you ate it πŸ’…βœ¨ signing off from ./drivers/base β€” dated October 2026 β€” version platform_device_set_fwnode(9), no cap πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from