linux/samples/rust
Danilo Krummrich 7fdffdda63 rust: driver: decouple driver private data from driver type
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.

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20260525202921.124698-5-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-05-27 16:22:41 +02:00
..
hostprogs samples: add first Rust examples 2022-09-28 09:03:08 +02:00
Kconfig rust: Add SoC Driver Sample 2025-12-28 12:44:31 +01:00
Makefile rust: Add SoC Driver Sample 2025-12-28 12:44:31 +01:00
rust_configfs.rs rust: configfs: replace kernel::c_str! with C-Strings 2026-01-15 09:26:49 +01:00
rust_debugfs_scoped.rs samples: rust: debugfs: replace kernel::c_str! with C-Strings 2025-12-22 17:30:35 +01:00
rust_debugfs.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_dma.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_driver_auxiliary.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_driver_faux.rs rust: samples: driver-core: remove redundant .as_ref() for dev_* print 2026-01-24 01:12:49 +01:00
rust_driver_i2c.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_driver_pci.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_driver_platform.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_driver_usb.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_i2c_client.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00
rust_minimal.rs rust: samples: add a module parameter to the rust_minimal sample 2025-11-03 14:42:34 +01:00
rust_misc_device.rs Char/Misc/IIO driver changes for 7.0-rc1 2026-02-17 09:11:04 -08:00
rust_print_events.c rust: samples: add tracepoint to Rust sample 2024-11-04 16:21:44 -05:00
rust_print_main.rs samples: rust: remove imports available via prelude 2026-01-26 18:15:20 +01:00
rust_soc.rs rust: driver: decouple driver private data from driver type 2026-05-27 16:22:41 +02:00