Re: [PATCH v3 03/27] rust: driver: decouple driver private data from driver type

From: Alexandre Courbot

Date: Mon May 18 2026 - 10:44:09 EST


On Sun May 17, 2026 at 9:00 AM JST, Danilo Krummrich wrote:
> Add a type Data<'bound> associated type to all bus driver traits,
> decoupling the driver's bus device private data type from the driver
> struct itself.
>
> In the context of adding a 'bound lifetime, making this an associated
> type has the advantage that it allows us to avoid a driver trait global
> lifetime and it avoids the need for ForLt for bus device private data;
> both of which make the subsequent implementation by buses much simpler.
>
> All existing drivers and doc examples set type Data = Self to preserve
> the current behavior.
>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>