@@ -18215,6 +18215,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git
F: Documentation/ABI/testing/sysfs-firmware-ofw
F: drivers/of/
F: include/linux/of*.h
+F: rust/helpers/of.c
F: rust/kernel/of.rs
F: scripts/dtc/
F: tools/testing/selftests/dt/
@@ -21,6 +21,7 @@
#include "jump_label.c"
#include "kunit.c"
#include "mutex.c"
+#include "of.c"
#include "page.c"
#include "platform.c"
#include "pci.c"
new file mode 100644
@@ -0,0 +1,6 @@
+#include <linux/of.h>
+
+bool rust_helper_is_of_node(const struct fwnode_handle *fwnode)
+{
+ return is_of_node(fwnode);
+}
Add a helper function to determine whether a given device appears to be an Open Firmware (OF) node. This function will be used in Rust driver abstractions to support both ACPI and OF matching simultaneously in subsequent patches. Signed-off-by: Igor Korotin <igor.korotin.linux@gmail.com> --- MAINTAINERS | 1 + rust/helpers/helpers.c | 1 + rust/helpers/of.c | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 rust/helpers/of.c