[PATCH 04/10] samples: rust: pci: specify base type for registers

From: Gary Guo

Date: Tue Jul 21 2026 - 13:00:42 EST


The `register!` macro is going to require explicit base type, specify it
for both `register!` usages in PCI sample driver.

Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
---
samples/rust/rust_driver_pci.rs | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs
index 1aa8197d8698..aca8af795785 100644
--- a/samples/rust/rust_driver_pci.rs
+++ b/samples/rust/rust_driver_pci.rs
@@ -23,6 +23,8 @@ mod regs {
use super::*;

register! {
+ base: kernel::io::Region<END>;
+
pub(super) TEST(u8) @ 0x0 {
7:0 index => TestIndex;
}
@@ -103,6 +105,8 @@ fn config_space(pdev: &pci::Device<Bound>) {

// Some PCI configuration space registers.
register! {
+ base: pci::Normal;
+
VENDOR_ID(u16) @ 0x0 {
15:0 vendor_id;
}

--
2.54.0