platform_device_del(9)
π 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 astruct 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
platform_get_resource(9)devm_platform_get_and_ioremap_resource(9)devm_platform_ioremap_resource(9)devm_platform_ioremap_resource_byname(9)platform_get_irq_affinity(9)platform_get_irq_optional(9)platform_get_irq(9)platform_irq_count(9)devm_platform_get_irqs_affinity(9)platform_get_resource_byname(9)platform_get_irq_byname(9)platform_get_irq_byname_optional(9)platform_add_devices(9)platform_device_put(9)platform_device_alloc(9)platform_device_add_resources(9)platform_device_add_data(9)platform_device_set_of_node(9)platform_device_set_fwnode(9)platform_device_set_of_node_from_dev(9)platform_device_add(9)platform_device_register(9)platform_device_unregister(9)platform_device_register_full(9)__platform_driver_register(9)platform_driver_unregister(9)__platform_driver_probe(9)__platform_create_bundle(9)__platform_register_drivers(9)platform_unregister_drivers(9)platform_match(9)platform_find_device_by_driver(9)
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
- 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