__platform_create_bundle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« __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 __init section. 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 with data. 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:


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