summaryrefslogtreecommitdiff
path: root/rust/kernel/platform.rs
diff options
context:
space:
mode:
authorIgor Korotin <igor.korotin.linux@gmail.com>2025-06-20 16:39:13 +0100
committerDanilo Krummrich <dakr@kernel.org>2025-06-26 23:26:10 +0200
commit7a5cb145a9ce844be41ca5ed26e7d8d7c41dec7d (patch)
tree25fb21325972c8def5961b5909dfe287921083de /rust/kernel/platform.rs
parent0f549d25858dfef9decd0b99a82ff4bc9095a51f (diff)
rust: driver: Add ACPI id table support to Adapter trait
Extend the `Adapter` trait to support ACPI device identification. This mirrors the existing Open Firmware (OF) support (`of_id_table`) and enables Rust drivers to match and retrieve ACPI-specific device data when `CONFIG_ACPI` is enabled. To avoid breaking compilation, a stub implementation of `acpi_id_table()` is added to the Platform adapter; the full implementation will be provided in a subsequent patch. Signed-off-by: Igor Korotin <igor.korotin.linux@gmail.com> Link: https://lore.kernel.org/r/20250620153914.295679-1-igor.korotin.linux@gmail.com [ Fix clippy warning if #[cfg(not(CONFIG_OF))]; fix checkpatch.pl line length warnings. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/platform.rs')
-rw-r--r--rust/kernel/platform.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs
index 5b21fa517e55..5923d29a0511 100644
--- a/rust/kernel/platform.rs
+++ b/rust/kernel/platform.rs
@@ -5,7 +5,7 @@
//! C header: [`include/linux/platform_device.h`](srctree/include/linux/platform_device.h)
use crate::{
- bindings, container_of, device, driver,
+ acpi, bindings, container_of, device, driver,
error::{to_result, Result},
of,
prelude::*,
@@ -94,6 +94,10 @@ impl<T: Driver + 'static> driver::Adapter for Adapter<T> {
fn of_id_table() -> Option<of::IdTable<Self::IdInfo>> {
T::OF_ID_TABLE
}
+
+ fn acpi_id_table() -> Option<acpi::IdTable<Self::IdInfo>> {
+ None
+ }
}
/// Declares a kernel module that exposes a single platform driver.