[PATCH 09/11] samples: rust: rust_driver_pci: update to use new bar and io api
Andrew Ballance
andrewjballance at gmail.com
Fri May 9 03:15:22 UTC 2025
update rust_driver_pci.rs to use the new bar and io api.
Signed-off-by: Andrew Ballance <andrewjballance at gmail.com>
---
samples/rust/rust_driver_pci.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs
index 2bb260aebc9e..b645155142db 100644
--- a/samples/rust/rust_driver_pci.rs
+++ b/samples/rust/rust_driver_pci.rs
@@ -4,7 +4,9 @@
//!
//! To make this driver probe, QEMU must be run with `-device pci-testdev`.
-use kernel::{bindings, c_str, device::Core, devres::Devres, pci, prelude::*, types::ARef};
+use kernel::{
+ bindings, c_str, device::Core, devres::Devres, io::IoAccess, pci, prelude::*, types::ARef,
+};
struct Regs;
@@ -16,7 +18,7 @@ impl Regs {
const END: usize = 0x10;
}
-type Bar0 = pci::Bar<{ Regs::END }>;
+type Bar0 = pci::IoBar<{ Regs::END }>;
#[derive(Debug)]
struct TestIndex(u8);
--
2.49.0
More information about the dri-devel
mailing list