[PATCH 2/8] rust: driver: make `DriverModule` struct pub(crate) in `module_driver!`

From: Alvin Sun

Date: Tue May 19 2026 - 02:27:01 EST


Expose the generated `DriverModule` struct as `pub(crate)` so that
driver implementations can reference it via `super::DriverModule`
for the `ThisModule` associated type.

Signed-off-by: Alvin Sun <alvin.sun@xxxxxxxxx>
---
rust/kernel/driver.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs
index 36de8098754d0..9c7c69c4d2af0 100644
--- a/rust/kernel/driver.rs
+++ b/rust/kernel/driver.rs
@@ -253,7 +253,7 @@ macro_rules! module_driver {
type Ops<$gen_type> = $driver_ops;

#[$crate::prelude::pin_data]
- struct DriverModule {
+ pub(crate) struct DriverModule {
#[pin]
_driver: $crate::driver::Registration<Ops<$type>>,
}

--
2.43.0