acpi_create_platform_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ acpi_create_platform_device ✨

okay so bestie, we're in the Kernel API Manual</> today, section 9 β€” and the function on the menu is acpi_create_platform_device, which is literally the glow-up machine that turns an ACPI device node into a platform device. yes ma'am, we're doing firmware-to-platform matchmaking πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

struct platform_device * acpi_create_platform_device (struct acpi_device
       *adev , const struct property_entry *properties );

like, look at her. returning a struct platform_device * and everything. main character energy fr fr 🫢


🌸 ARGUMENTS 🌸

  • adev β€” the ACPI device node you want a platform device for. this is the one getting the makeover πŸ’–
  • properties β€” an optional collection of build-in properties. optional!! so you can totally leave it out, no pressure πŸ¦‹

πŸ’« DESCRIPTION πŸ’«

so here's the vibe check: the function first checks whether the given adev can even be represented as a platform device. if that's the case, it creates and registers a platform device, populates its common resources, and returns a pointer to it. slay ✨

if it can't? it returns NULL. not every ACPI node gets to be a platform device, and that's okay 😭

and the bestie detail: the name of the platform device will be the same as adev's. same name, same energy, no cap πŸ‘‘

lowkey important: a NULL return here isn't necessarily an error situation β€” it literally just means this adev isn't representable as a platform device, iykyk.

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/acpi/acpi_platform.c β€” go read the source, it's giving iconic behavior 🧚

and that's the whole page bestie β€” brought to you by the fine folks at</> ./drivers/acpi, dated</> October 2026, for</> acpi_create_platform_device(9). periodt. πŸ’œβœ¨πŸŽ€</>

πŸ“¦ where this page comes from