of_flat_dt_match_machine(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– of_flat_dt_match_machine(9) πŸ’–

okay so welcome to the Kernel API Manual, bestie β€” yes this is a real manual page from the kernel, and yes it's about finding out which machine you're on. very main character energy, i fear. let's get into it ✨


🌸 NAME 🌸

of_flat_dt_match_machine β€” literally it just iterates the match tables to find the matching machine. that's the whole vibe check right there, no cap πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

const void * of_flat_dt_match_machine (const void *default_match ,
                                       const void * (*get_next_compat)(const char * const**) );

like... look at that signature. two args. one's a pointer, one's a callback that returns a pointer to a function... it's giving "function pointers are my entire personality" and honestly? respect πŸ’…


⭐ ARGUMENTS ⭐

  • default_match β€” a machine specific ptr that gets returned in case of no match. so like, your fallback bestie when nobody else shows up to the party 😭 it's the "you tried" consolation prize.
  • get_next_compat β€” callback function to return the next compatible match table. so every time the loop wants more tables, it hits this up and it's like "here's the next one, queen" 🫢

✨ DESCRIPTION ✨

So the whole thing: it iterates through the machine match tables to find the best match for the machine compatible string in the FDT. that's it, that's the plot πŸ’–

it's shuffling through the flat device tree match tables going "are you my machine? no? next." until it hits the right one. iconic behavior honestly. and if literally none of them match, you get back default_match β€” the friend that was always there πŸ₯Ί


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/of/fdt.c β€” and also a whole squad of siblings, all lowercase, all with (9), all lowkey obsessed with the flat device tree:

like the whole friend group showed up. iykyk 🌈


ngl there's no extra warnings in here, just vibes and pointers. but fr fr, if you're poking at this in the kernel, remember: default_match is your safety net, and get_next_compat is doing all the actual work πŸ˜ŒπŸ’€

okay that's the page, bestie 🧚 from ./drivers/of, dated October 2026, and it's of_flat_dt_match_machine(9) β€” slay, go forth and match your machine πŸ’œπŸŽ€

πŸ“¦ where this page comes from