STRUCT OF_DEV_AUXDATA(9)
π 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. aresource_size_t, no cap.nameβ the name to assign to matching nodes. you're renaming them, essentially. main character energy for real.platform_dataβ theplatform_datapointer to assign to matching nodes. avoid *, 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
- 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