STRUCT OF_DEV_AUXDATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct of_dev_auxdata(9) β€” from the Kernel API Manual, bestie

okay so we're doing struct of_dev_auxdata today and honestly? it's giving "small struct, big responsibilities." it's a lookup table entry for device names & platform_data, and yes that ampersand is doing heavy lifting. ✨


🌸 SYNOPSIS 🌸

struct of_dev_auxdata {
    char *compatible;
    resource_size_t phys_addr;
    char *name;
    void *platform_data;
 };

literally four fields. that's it. that's the whole queen. πŸ‘‘


πŸŽ€ Members πŸŽ€

  • compatible β€” the compatible value of the node we're matching against. it's how we recognize the node like "omg that's her" πŸ’–
  • phys_addr β€” start address of the registers to match against the node. a resource_size_t, no cap.
  • name β€” the name to assign to matching nodes. you're renaming them, essentially. main character energy for real.
  • platform_data β€” the platform_data pointer to assign to matching nodes. a void *, so like. be careful. πŸ™ˆ

πŸ¦‹ Description πŸ¦‹

so this lookup table lets the caller of of_platform_populate override the names of devices when it's creating devices from the device tree. yes, override. it's not a suggestion, it's a whole vibe change. and the table should be terminated with an empty entry β€” do not forget the empty entry, bestie, i'm serious, it will not know where to stop 😭

it also lets you set the platform_data pointer. so that's two things: names AND data.

why does this exist?? ok so the tea is: some Linux infrastructure uses the device name to look up a specific device, but the Linux-specific names are not encoded into the device tree. so the kernel has to step in and provide specific values itself. it's basically the kernel doing damage control. slay, i guess. πŸ”₯


⭐ Note ⭐

using an auxdata lookup table should be considered a last resort when converting a platform to use the DT. like, genuinely last. bottom of the list. ngl this is the "break glass in case of emergency" option 🚨

normally the automatically generated device name will not matter, and drivers should obtain data from the device node instead of from an anonymous platform_data pointer. that's the healthy path. the auxdata path is the "i know a guy" path. πŸ’€


🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/of_platform.h

okay that's the whole page, you ate that fr fr 🫢 the source is ./include/linux and it's dated October 2026 β€” cute little timestamp, very demure, very mindful, and that's the sign-off bestie, mwah πŸ’œβœ¨

πŸ“¦ where this page comes from