[PATCH] rust: serdev: use ThisModule::as_ptr() instead of field access

Danilo Krummrich <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,dev.linux.lists.driver-core,org.kernel.vger.linux-kernel,org.kernel.vger.linux-serial
Message-ID <[email protected]>
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/[email protected]/ [1]
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Danilo Krummrich <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.