[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250620154124.297158-1-igor.korotin.linux@gmail.com>
Date: Fri, 20 Jun 2025 16:41:24 +0100
From: Igor Korotin <igor.korotin.linux@...il.com>
To: "Rafael J . Wysocki" <rafael@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Miguel Ojeda <ojeda@...nel.org>,
Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>
Cc: Alex Hung <alex.hung@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Igor Korotin <igor.korotin.linux@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Remo Senekowitsch <remo@...nzli.dev>,
Tamir Duberstein <tamird@...il.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Xiangfei Ding <dingxiangfei2009@...il.com>,
devicetree@...r.kernel.org,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Alice Ryhl <aliceryhl@...gle.com>,
Andreas Hindborg <a.hindborg@...nel.org>,
Benno Lossin <lossin@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Danilo Krummrich <dakr@...nel.org>,
Gary Guo <gary@...yguo.net>,
Len Brown <lenb@...nel.org>,
Trevor Gross <tmgross@...ch.edu>
Subject: [PATCH v8 7/9] 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