Re: [PATCH v5 11/24] rust: device: make Core and CoreInternal lifetime-parameterized
From: Gary Guo
Date: Wed May 27 2026 - 09:25:16 EST
On Mon May 25, 2026 at 9:20 PM BST, Danilo Krummrich wrote:
> Device<Core> references in probe callbacks are scoped to the callback,
> not the full binding duration. Add a lifetime parameter to Core and
> CoreInternal to accurately represent this in the type system.
>
> Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
> Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> drivers/cpufreq/rcpufreq_dt.rs | 2 +-
> drivers/gpu/drm/nova/driver.rs | 5 ++-
> drivers/gpu/drm/tyr/driver.rs | 2 +-
> drivers/gpu/nova-core/driver.rs | 4 +--
> drivers/gpu/nova-core/gpu.rs | 2 +-
> drivers/pwm/pwm_th1520.rs | 2 +-
> rust/kernel/auxiliary.rs | 12 ++++---
> rust/kernel/cpufreq.rs | 2 +-
> rust/kernel/device.rs | 49 +++++++++++++++++++++------
> rust/kernel/devres.rs | 2 +-
> rust/kernel/dma.rs | 2 +-
> rust/kernel/driver.rs | 6 ++--
> rust/kernel/i2c.rs | 16 ++++-----
> rust/kernel/io/mem.rs | 4 +--
> rust/kernel/pci.rs | 20 ++++++-----
> rust/kernel/pci/id.rs | 2 +-
> rust/kernel/platform.rs | 12 +++----
> rust/kernel/usb.rs | 16 ++++-----
> samples/rust/rust_debugfs.rs | 4 +--
> samples/rust/rust_dma.rs | 2 +-
> samples/rust/rust_driver_auxiliary.rs | 7 ++--
> samples/rust/rust_driver_i2c.rs | 6 ++--
> samples/rust/rust_driver_pci.rs | 4 +--
> samples/rust/rust_driver_platform.rs | 2 +-
> samples/rust/rust_driver_usb.rs | 8 ++---
> samples/rust/rust_i2c_client.rs | 4 +--
> samples/rust/rust_soc.rs | 2 +-
> 27 files changed, 118 insertions(+), 81 deletions(-)