diff mbox series

[v7,7/9] rust: platform: Set `OF_ID_TABLE` default to `None` in `Driver` trait

Message ID 20250618102216.3049450-1-igor.korotin.linux@gmail.com
State Superseded
Headers show
Series rust: Add ACPI match table support for Rust drivers | expand

Commit Message

Igor Korotin June 18, 2025, 10:22 a.m. UTC
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@gmail.com>
---
 rust/kernel/platform.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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.
     ///