[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250605162454.3659309-1-igor.korotin.linux@gmail.com>
Date: Thu, 5 Jun 2025 17:24:53 +0100
From: Igor Korotin <igor.korotin.linux@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
devicetree@...r.kernel.org
Cc: Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Len Brown <lenb@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Alex Hung <alex.hung@....com>,
Tamir Duberstein <tamird@...il.com>,
FUJITA Tomonori <fujita.tomonori@...il.com>,
Xiangfei Ding <dingxiangfei2009@...il.com>,
Igor Korotin <igor.korotin.linux@...il.com>
Subject: [PATCH v2 2/5] rust: helpers: Add `is_of_node` helper function
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@...il.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
diff --git a/MAINTAINERS b/MAINTAINERS
index 5f8dfae08454..d6cadaa592aa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -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/
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 80785b1e7a63..2fc5242aa47a 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -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"
diff --git a/rust/helpers/of.c b/rust/helpers/of.c
new file mode 100644
index 000000000000..8913eaced716
--- /dev/null
+++ b/rust/helpers/of.c
@@ -0,0 +1,6 @@
+#include <linux/of.h>
+
+bool rust_helper_is_of_node(const struct fwnode_handle *fwnode)
+{
+ return is_of_node(fwnode);
+}
--
2.43.0
Powered by blists - more mailing lists