of_find_node_with_property(9)
π of_find_node_with_property β from the Kernel API Manual, bestie π
okay so real talk, this page is of_find_node_with_property(9) and it's like... the friend who finds the person at the party who has the exact thing you're looking for. It's in the Kernel API Manual, and I'm gonna walk you through it like we're texting at 2am π¦
β¨ NAME β¨
of_find_node_with_property β Find a node which has a property with the given name.
like, that's it. that's the whole vibe check. it goes looking for a node, and the node it wants is the one carrying a property with the name you gave it. periodt π
πΈ SYNOPSIS πΈ
struct device_node * of_find_node_with_property (struct device_node
*from , const char *prop_name );
note the return type: struct device_node *. you're getting a pointer back, not the actual node. keep that in mind for the RETURN section, because it MATTERS, and I'm not gonna let you forget it π
π«Ά ARGUMENTS π«Ά
fromβ the node you start searching from, orNULL. Here's the spicy part that people always get wrong: the node you pass will not be searched, only the next one will. So it's not "start here," it's "start after here." Typically you pass whatever the previous call returned β like a lil relay race πββοΈ. Also,of_node_putwill be called on it.prop_nameβ the name of the property you're looking for. the thing the node has to actually, physically, no-cap have. π₯
π RETURN π
You get a node pointer, and the refcount is incremented β so bestie, you own a reference now, and you've gotta call of_node_put on it when you're done. Not doing that is giving leak energy and we don't do that here ππ
π SEE ALSO π
Kernel file ./drivers/of/base.c β plus literally the whole extended friend group:
of_find_all_nodes(9)__of_device_is_compatible(9)of_machine_compatible_match(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_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)
ngl that SEE ALSO list is giving "invited the entire group chat to the function" but every single one of them is iconic in their own right π
k that's the whole page, mwah π β sourced from ./drivers/of, dated October 2026, and this was of_find_node_with_property(9) from the Kernel API Manual. go forth and call of_node_put, my love π§ββοΈβ
π¦ 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