platform_device_del(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… platform_device_del β€” like, the Kernel API Manual one, bestie

okay so real talk, this is platform_device_del from the Kernel API Manual and it's honestly giving "cleanup era" in the best way. sit down, grab a lil snack, we're gonna get into it πŸ“


✨ NAME ✨

platform_device_del β€” remove a platform-level device. that's it, that's the whole vibe check πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

void platform_device_del (struct platform_device *pdev );

like yes, that's the whole signature, no cap. void in, void out, the function does its thing and does not return anything to you. periodt ✨


🌸 ARGUMENTS 🌸

  • pdev β€” the platform device we're removing. that's your main character right there, the one getting yeeted πŸ‘‹ it's a struct platform_device *, k?

πŸ’– DESCRIPTION πŸ’–

okay so listen up because this part actually matters πŸ”₯

lowkey this function doesn't just remove the device β€” it also releases all memory- and port-based resources owned by the device, and those live in dev->resource. so like, all of it, gone, freed, bye πŸ™ˆ so don't be out here assuming your resources are still yours afterwards, because they are so not.

🚨 and here's the big one, bestie: this function must _only_ be externally called in error cases. that's _only_ with the underscores, which is manpage-speak for "I am not joking." all other usage is a bug. not a quirky little bug, not a "haha oops" bug β€” a bug bug. πŸ’€ so if you're calling this on the happy path, no you're not, go fix that fr fr.

🫢 SEE ALSO 🫢

like, all the sibling functions, the whole friend group 🧚 and yeah, the kernel file they live in too:

Kernel file ./drivers/base/platform.c

like, that's the whole roster, go read them, iykyk πŸ’œ


and that's the page!! 🌈 this lil cutie lives over in ./drivers/base, dated October 2026, and it answers to platform_device_del(9) β€” mwah, slay, go forth and only call it in error cases πŸ’…βœ¨

πŸ“¦ where this page comes from