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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user