__platform_create_bundle(9)
π« __platform_create_bundle β Kernel API Manual β¨
okay bestie, so this page is literally called __platform_create_bundle(9) and it lives in the Kernel API Manual, and it's about the one-two punch of registering a driver and spinning up the device it goes with. no cap, it's a bundled deal π
πΈ NAME πΈ
__platform_create_bundle β register driver and create corresponding device
like, both things. at once. the driver registration and the device creation, together, in one call π
π¦ SYNOPSIS π¦
struct platform_device * __platform_create_bundle (struct platform_driver *driver , int (*probe)(struct platform_device *) , struct resource *res , unsigned int n_res , const void *data , size_t size , struct module *module , const char *mod_name );
that's a lot of parameters, i know π but stay with me, we're gonna go through every single one:
β¨ ARGUMENTS β¨
driverβ the platform driver structure π this is the driver that's gonna get registered.probeβ the driver probe routine, probably from an__initsection. yes, "probably" β that's the actual wording, don't @ me.resβ the set of resources that needs to be allocated for the device π§n_resβ number of resources. you know, the count of the thing above.dataβ platform specific data for this platform device πsizeβ size of platform specific data. yep, pairs withdata. iconic duo.moduleβ module which will be the owner of the driver πmod_nameβ module name string β
π₯ DESCRIPTION π₯
So here's the vibe check: use this in legacy-style modules that probe hardware directly and register a single platform device and corresponding platform driver. that's the whole use case, iykyk π«Ά
Returns struct platform_device pointer on success, or ERR_PTR on error. so like, always check it β if it's an error pointer you gotta handle it, bestie, don't just vibe past it π
π SEE ALSO π
Kernel file ./drivers/base/platform.c β and honestly the whole platform family, here we go:
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_del(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_register_drivers(9)platform_unregister_drivers(9)platform_match(9)platform_find_device_by_driver(9)
and that's the whole page, bestie π this one's sourced from ./drivers/base and dated October 2026 β so go forth, register that bundle, and slay β¨ππ¦
π¦ 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