On Mon May 25, 2026 at 9:21 PM BST, Danilo Krummrich wrote:
> Add a 'bound lifetime to the associated Data, changing type Data to type
> Data<'bound>.
> 
> This allows the driver's bus device private data to capture the device /
> driver bound lifetime; device resources can be stored directly by
> reference rather than requiring Devres.
> 
> The probe() and unbind() callbacks thus gain a 'bound lifetime parameter
> on the methods themselves; avoiding a global lifetime on the trait impl.
> 
> Existing drivers set type Data<'bound> = Self, preserving the current
> behavior.
> 
> Acked-by: Igor Korotin <[email protected]>
> Reviewed-by: Alexandre Courbot <[email protected]>
> Reviewed-by: Greg Kroah-Hartman <[email protected]>
> Signed-off-by: Danilo Krummrich <[email protected]>

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

> ---
>  rust/kernel/i2c.rs              | 39 ++++++++++++++++++---------------
>  samples/rust/rust_driver_i2c.rs | 14 ++++++------
>  2 files changed, 28 insertions(+), 25 deletions(-)

Reply via email to