diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2026-05-25 23:21:00 +0300 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-05-27 17:23:31 +0300 |
| commit | 81fdc788144348f295cfaa4b1e1edf6c74441c15 (patch) | |
| tree | d0a814d64ef189889104b6f2c47a3cf401c8a900 /include/linux/root_dev.h | |
| parent | 16c2b8fdab7c0808ff36430b2f49569029a8f484 (diff) | |
| download | linux-81fdc788144348f295cfaa4b1e1edf6c74441c15.tar.xz | |
rust: platform: make Driver trait lifetime-parameterized
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: Uwe Kleine-König <ukleinek@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260525202921.124698-14-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'include/linux/root_dev.h')
0 files changed, 0 insertions, 0 deletions
