of_machine_compatible_match(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– of_machine_compatible_match β€” the man page, but make it cute

okay so bestie, this one's a kernel API page (of_machine_compatible_match(9), yes the whole manual name goes right there, iykyk) and it is literally so simple and so useful. it's a vibe check for your device tree root. let's go πŸŽ€


✨ NAME ✨

of_machine_compatible_match β€” Test root of device tree against a compatible array 🌸

like, the entire job. it looks at the root of the device tree and asks "hey bestie, do you match any of these strings?"


🌈 SYNOPSIS 🌈

bool of_machine_compatible_match (const char *const *compats );

returns a bool, takes one arg, no drama, periodt πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • compats β€” a NULL terminated array of compatible strings to look for in the root node's compatible property. so it's a list of strings, and the list is done when you hit a NULL. don't forget the NULL bestie, it's the whole "terminated" thing, no cap πŸ™ˆ

πŸ‘‘ DESCRIPTION πŸ‘‘

Returns true if the root node has any of the given compatible values in its compatible property.

that's it. that's the whole function. if any one of your compats strings shows up in the root node's compatible property, you get true β€” otherwise it's not giving, and you don't. any of them. one match is enough. iconic behaviour honestly ⭐

lowkey the easiest W in the whole of/ subsystem. no traversal, no stress, just "does the root match" πŸ”₯

🫢 SEE ALSO 🫢

the whole squad, all linked, all (9), and the kernel file that makes it happen: Kernel file ./drivers/of/base.c alongside of_find_all_nodes(9), __of_device_is_compatible(9), of_machine_read_compatible(9), of_machine_read_model(9), of_machine_get_match(9), of_machine_get_match_data(9), __of_device_is_available(9), __of_device_is_reserved(9), of_device_is_available(9), __of_device_is_fail(9), of_device_is_big_endian(9), of_get_parent(9), of_get_next_parent(9), of_get_next_child(9), of_get_next_child_with_prefix(9), of_get_next_available_child(9), of_get_next_reserved_child(9), of_get_next_cpu_node(9), of_get_compatible_child(9), of_get_child_by_name(9), of_get_available_child_by_name(9), of_find_node_opts_by_path(9), of_find_node_by_name(9), of_find_node_by_type(9), of_find_compatible_node(9), of_find_node_with_property(9), of_match_node(9), of_find_matching_node_and_match(9), of_alias_from_compatible(9), of_find_node_by_phandle(9), of_parse_phandle_with_args_map(9), of_count_phandle_with_args(9), __of_add_property(9), of_add_property(9), of_remove_property(9), of_alias_scan(9), of_alias_get_id(9), of_alias_get_highest_id(9), of_console_check(9), of_find_next_cache_node(9), of_find_last_cache_level(9), of_map_id(9), of_map_iommu_id(9), of_map_msi_id(9).

bestie go read all of them, or don't, i'm not your mom, but they're all right there πŸ’œ


that's the whole page!! xoxo, written from ./drivers/of (October 2026) and signed of_machine_compatible_match(9) β€” mwah πŸ’‹πŸŽ€βœ¨

πŸ“¦ where this page comes from