platform_device_add_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… platform_device_add_data(9) πŸ’…

okay so this one lives in the Kernel API Manual, bestie, and it's genuinely one of the more glam little helpers in drivers/base. it's giving "put my data on my device" energy and honestly? we're obsessed.


✨ NAME ✨

platform_device_add_data β€” adds platform-specific data to a platform device πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int platform_device_add_data (struct platform_device *pdev , const void *data , size_t size );

like literally that's the whole signature, no cap πŸ’–


🌸 ARGUMENTS 🌸

  • pdev β€” the platform device you got from platform_device_alloc, and you're adding resources to it. main character device fr.
  • data β€” the platform specific data for this platform device. your little payload πŸ“
  • size β€” the size of that platform specific data. gotta know how much we're working with πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so what it actually does: it adds a copy of your platform specific data onto the platform device's platform_data pointer. a copy, bestie β€” not your pointer, a whole fresh copy ✨

and the memory that's associated with the platform data? it gets freed automatically when the platform device is released. so you don't have to stress about cleanup, the kernel's got you 🫢


πŸ’œ SEE ALSO πŸ’œ

okay this list is LONG but every single one of these is a baddie, so here we go:


and that's the whole page, periodt ✨ this icon was brought to you by the <bold>./drivers/base</bold> girlies, dated October 2026 β€” go forth and add your data, bestie, you're gonna slay πŸ’…πŸ‘‘

πŸ“¦ where this page comes from