On Mon May 25, 2026 at 9:21 PM BST, Danilo Krummrich wrote:
> 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.

It looks like the original code doesn't need pin_init to begin with, so it's not
like the lifetime actually helps here, but it's still a good cleanup.

Reviewed-by: Gary Guo <[email protected]>

> 
> Reviewed-by: Eliot Courtney <[email protected]>
> Reviewed-by: Greg Kroah-Hartman <[email protected]>
> Reviewed-by: Alexandre Courbot <[email protected]>
> Signed-off-by: Danilo Krummrich <[email protected]>
> ---
>  samples/rust/rust_driver_pci.rs | 89 +++++++++++++++------------------
>  1 file changed, 40 insertions(+), 49 deletions(-)

Reply via email to