diff options
| author | Benno Lossin <lossin@kernel.org> | 2025-09-05 16:00:46 +0200 |
|---|---|---|
| committer | Benno Lossin <lossin@kernel.org> | 2025-09-11 23:30:02 +0200 |
| commit | 42415d163e5df6db799c7de6262d707e402c2c7e (patch) | |
| tree | 49ce36ce08e84730400e2da8d9ddb4e968652c0e /samples/rust | |
| parent | 1fa516794fdd27b96cee77f8b12ac916b8b6a9a7 (diff) | |
rust: pin-init: add references to previously initialized fields
After initializing a field in an initializer macro, create a variable
holding a reference that points at that field. The type is either
`Pin<&mut T>` or `&mut T` depending on the field's structural pinning
kind.
[ Applied fixes to devres and rust_driver_pci sample - Benno]
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Benno Lossin <lossin@kernel.org>
Diffstat (limited to 'samples/rust')
| -rw-r--r-- | samples/rust/rust_driver_pci.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs index 606946ff4d7f..1ac0b06fa3b3 100644 --- a/samples/rust/rust_driver_pci.rs +++ b/samples/rust/rust_driver_pci.rs @@ -78,8 +78,8 @@ impl pci::Driver for SampleDriver { let drvdata = KBox::pin_init( try_pin_init!(Self { - pdev: pdev.into(), bar <- pdev.iomap_region_sized::<{ Regs::END }>(0, c_str!("rust_driver_pci")), + pdev: pdev.into(), index: *info, }), GFP_KERNEL, |