of_machine_read_compatible(9)
π» of_machine_read_compatible β the "who even IS this machine" function β¨
okay so this one lives in the Kernel API Manual (section 9, the kernel-API girlies π), and it's literally your go-to for grabbing the compatible string of this machine. that's it. that's the vibe. iykyk π
πΈ NAME πΈ
of_machine_read_compatible β Get the compatible string of this machine
(no cap, that's the whole pitch π«Ά)
β¨ SYNOPSIS β¨
int of_machine_read_compatible (const char **compatible , unsigned int
index );
look at her. two params, one int coming back at you. so clean. so iconic. π
π§ ARGUMENTS π§
compatibleβ this is the address at which the address of the compatible string will be stored. yes bestie, address of an address β it's pointer-to-a-pointer realness π you hand it a spot, it drops the address of the compatible string in there.indexβ the index of the compatible entry in the list. like, which one do you want? there's a list, you pick a slot. literally that simple π
β RETURN β
0on success π- negative error number on failure π
that's it. zero means slay, negative means the machine said no π
π₯ SEE ALSO π₯
okay this is the part where the page just. keeps. going. and honestly? respect. she knows everyone. here's the whole group chat, and inside it is the kernel file ./drivers/of/base.c β that's where the magic lives, no cap:
of_find_all_nodes(9)__of_device_is_compatible(9)of_machine_compatible_match(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)
forty-four entries. that's not a see-also, that's a whole friend group π«Άβ¨
π quick vibe check: compatible has to be a place you can write to, because the function is storing the address of the compatible string there β not the string itself.
π the cute little sign-off π
this page comes to you from ./drivers/of (the source), and it's dated October 2026 β so yeah, she's fresh, she's current, she's giving main character energy ππ thanks for reading bestie, go read some device trees, 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