summaryrefslogtreecommitdiff
path: root/rust/macros/module.rs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-09 08:40:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-09 08:40:22 +0200
commitf299cd11f7539482e87b2d2d527968a26b33f0ec (patch)
treeabc4443b5666f567f3b83bf2a0cefe87a8930101 /rust/macros/module.rs
parent9c0c11bb87b09a8b7cdc21ca1090e7b36abe9d09 (diff)
parentda3ea35007d0af457a0afc87e84fddaebc4e0b63 (diff)
Merge 6.11-rc7 into usb-next
We need the USB fixes in here as well, and this also resolves the merge conflict in: drivers/usb/typec/ucsi/ucsi.c Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/macros/module.rs')
-rw-r--r--rust/macros/module.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 411dc103d82e..7a5b899e47b7 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -217,7 +217,11 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
// freed until the module is unloaded.
#[cfg(MODULE)]
static THIS_MODULE: kernel::ThisModule = unsafe {{
- kernel::ThisModule::from_ptr(&kernel::bindings::__this_module as *const _ as *mut _)
+ extern \"C\" {{
+ static __this_module: kernel::types::Opaque<kernel::bindings::module>;
+ }}
+
+ kernel::ThisModule::from_ptr(__this_module.get())
}};
#[cfg(not(MODULE))]
static THIS_MODULE: kernel::ThisModule = unsafe {{