]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
samples: rust: rust_driver_pci: use HRT lifetime for Bar
authorDanilo Krummrich <dakr@kernel.org>
Mon, 25 May 2026 20:21:07 +0000 (22:21 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Wed, 27 May 2026 14:24:32 +0000 (16:24 +0200)
commite397d405c4c6117b4eeeeecb8170c17c604ee6cc
treeaa60f0f68b9cc304c7bd1add0a8992f76671f43b
parent89f55d04c6028fa15800a4887faf51bdeebfa431
samples: rust: rust_driver_pci: use HRT lifetime for Bar

Convert the sample driver to SampleDriver<'bound>, taking advantage of
the lifetime-parameterized Driver trait.

The driver struct holds &'bound pci::Device directly instead of
ARef<pci::Device>, and pci::Bar<'bound> directly instead of
Devres<pci::Bar>. This removes PinnedDrop, pin_init_scope, and runtime
revocation checks on BAR access.

Reviewed-by: Eliot Courtney <ecourtney@nvidia.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260525202921.124698-21-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
samples/rust/rust_driver_pci.rs