mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
rust: module: add type LocalModule
The `LocalModule` type is the type of the module created by `module!`, `module_pci_driver!`, `module_platform_driver!`, etc. Since the exact type of the module is sometimes generated on the fly by the listed macros, provide an alias. This is first used by the `module_firmware!` macro. Acked-by: Miguel Ojeda <ojeda@kernel.org> Suggested-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250306222336.23482-2-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
7eb172143d
commit
d4245284c8
1 changed files with 4 additions and 0 deletions
|
|
@ -228,6 +228,10 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
|
|||
kernel::ThisModule::from_ptr(core::ptr::null_mut())
|
||||
}};
|
||||
|
||||
/// The `LocalModule` type is the type of the module created by `module!`,
|
||||
/// `module_pci_driver!`, `module_platform_driver!`, etc.
|
||||
type LocalModule = {type_};
|
||||
|
||||
impl kernel::ModuleMetadata for {type_} {{
|
||||
const NAME: &'static kernel::str::CStr = kernel::c_str!(\"{name}\");
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue