[PATCH 04/10] samples: rust: pci: specify base type for registers
Gary Guo <[email protected]> Tue, 21 Jul 2026 17:54:28 +0100
| Newsgroups | dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- 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