MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / FindCompatibleNode

Method FindCompatibleNode

src/include/kernel_fdt.hpp:690–697  ·  view source on GitHub ↗

* @brief 按 compatible 查找第一个匹配的节点 * @param compatible 要查找的 compatible 字符串 * @return Expected 节点偏移量 */

Source from the content-addressed store, hash-verified

688 * @return Expected<int> 节点偏移量
689 */
690 [[nodiscard]] auto FindCompatibleNode(const char* compatible) const
691 -> Expected<int> {
692 auto offset = fdt_node_offset_by_compatible(fdt_header_, -1, compatible);
693 if (offset < 0) {
694 return std::unexpected(Error(ErrorCode::kFdtNodeNotFound));
695 }
696 return offset;
697 }
698
699 /**
700 * @brief 根据 compatible 查找已启用的节点(跳过 status="disabled"

Callers

nothing calls this directly

Calls 1

ErrorClass · 0.85

Tested by

no test coverage detected