Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] rust: serdev: use ThisModule::as_ptr() instead of field access
@ 2026-08-13 15:24 Danilo Krummrich
  2026-08-13 15:53 ` Markus Probst
  2026-08-13 16:08 ` Gary Guo
  0 siblings, 2 replies; 5+ messages in thread
From: Danilo Krummrich @ 2026-08-13 15:24 UTC (permalink / raw)
  To: markus.probst, gregkh, rafael, dakr, ojeda, boqun, gary,
	bjorn3_gh, lossin, a.hindborg, aliceryhl, tmgross, daniel.almeida,
	tamird, acourbot, work
  Cc: driver-core, linux-serial, rust-for-linux, linux-kernel

The THIS_MODULE series [1] applied to rust-next moved ThisModule from
lib.rs into a module.rs submodule, making the tuple struct field private
outside the module. This breaks the module.0 field access in serdev in
driver-core-next.

Update the call to __serdev_device_driver_register() to use the public
module.as_ptr() accessor to fix the build.

Link: https://lore.kernel.org/all/20260811-fix-fops-owner-v10-0-7e71776f9dbe@linux.dev/ [1]
Closes: https://lore.kernel.org/all/DKNAS52KYWLD.M15VEC6U0F6R@kernel.org/
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 rust/kernel/serdev.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
index c0cd24481ee3..eecb1117095c 100644
--- a/rust/kernel/serdev.rs
+++ b/rust/kernel/serdev.rs
@@ -87,7 +87,7 @@ unsafe fn register(
         }
 
         // SAFETY: `sdrv` is guaranteed to be a valid `DriverType`.
-        to_result(unsafe { bindings::__serdev_device_driver_register(sdrv.get(), module.0) })
+        to_result(unsafe { bindings::__serdev_device_driver_register(sdrv.get(), module.as_ptr()) })
     }
 
     unsafe fn unregister(sdrv: &Opaque<Self::DriverType>) {

base-commit: 8364d0e36cbbdfe9adb65a170a70cbe3cdb02ff9
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-13 16:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 15:24 [PATCH] rust: serdev: use ThisModule::as_ptr() instead of field access Danilo Krummrich
2026-08-13 15:53 ` Markus Probst
2026-08-13 16:08   ` Gary Guo
2026-08-13 16:10   ` Danilo Krummrich
2026-08-13 16:08 ` Gary Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox