[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250613134510.1231709-1-igor.korotin.linux@gmail.com>
Date: Fri, 13 Jun 2025 14:45:10 +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 v6 4/6] rust: platform: Set `OF_ID_TABLE` default to `None` in `Driver` trait
Provide a default value of `None` for `Driver::OF_ID_TABLE` to simplify
driver implementations.
Drivers that do not require OpenFirmware matching no longer need to
import the `of` module or define the constant explicitly.
This reduces unnecessary boilerplate and avoids pulling in unused
dependencies.
Signed-off-by: Igor Korotin <igor.korotin.linux@...il.com>
---
rust/kernel/platform.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs
index 5923d29a0511..2436f55b579b 100644
--- a/rust/kernel/platform.rs
+++ b/rust/kernel/platform.rs
@@ -162,7 +162,7 @@ pub trait Driver: Send {
type IdInfo: 'static;
/// The table of OF device ids supported by the driver.
- const OF_ID_TABLE: Option<of::IdTable<Self::IdInfo>>;
+ const OF_ID_TABLE: Option<of::IdTable<Self::IdInfo>> = None;
/// Platform driver probe.
///
--
2.43.0
Powered by blists - more mailing lists