[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250618101325.3048187-1-igor.korotin.linux@gmail.com>
Date: Wed, 18 Jun 2025 11:13:25 +0100
From: Igor Korotin <igor.korotin.linux@...il.com>
To: ojeda@...nel.org,
alex.gaynor@...il.com,
rafael@...nel.org,
gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
linux-acpi@...r.kernel.org
Cc: boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me,
a.hindborg@...nel.org,
aliceryhl@...gle.com,
tmgross@...ch.edu,
dakr@...nel.org,
lenb@...nel.org,
wedsonaf@...il.com,
viresh.kumar@...aro.org,
alex.hung@....com,
dingxiangfei2009@...il.com
Subject: [PATCH v7 3/9] samples: rust: platform: conditionally call Self::properties_parse()
From: Danilo Krummrich <dakr@...nel.org>
Only call Self::properties_parse() when the device is compatible with
"test,rust-device".
Once we add ACPI support, we don't want the ACPI device to fail probing
in Self::properties_parse().
Signed-off-by: Danilo Krummrich <dakr@...nel.org>
---
samples/rust/rust_driver_platform.rs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/samples/rust/rust_driver_platform.rs b/samples/rust/rust_driver_platform.rs
index 000bb915af60..036dd0b899b0 100644
--- a/samples/rust/rust_driver_platform.rs
+++ b/samples/rust/rust_driver_platform.rs
@@ -40,7 +40,12 @@ fn probe(
dev_info!(dev, "Probed with info: '{}'.\n", info.0);
}
- Self::properties_parse(dev)?;
+ if dev
+ .fwnode()
+ .is_some_and(|node| node.is_compatible(c_str!("test,rust-device")))
+ {
+ Self::properties_parse(dev)?;
+ }
let drvdata = KBox::new(Self { pdev: pdev.into() }, GFP_KERNEL)?;
--
2.43.0
Powered by blists - more mailing lists