mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
rust: configfs: use LocalModule for THIS_MODULE
Replace the `THIS_MODULE` static reference in the `configfs_attrs!` macro with `this_module::<LocalModule>()`, and update rnull to import `LocalModule` instead of `THIS_MODULE`, consistent with the move of `THIS_MODULE` into the `ModuleMetadata` trait. Assisted-by: opencode:glm-5.2 Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Acked-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Alvin Sun <alvin.sun@linux.dev> Link: https://patch.msgid.link/20260811-fix-fops-owner-v10-7-7e71776f9dbe@linux.dev [ Rebased to avoid the imports cleanup patch. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
f9a2e4f3d7
commit
003c01b2f0
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
use super::{NullBlkDevice, THIS_MODULE};
|
||||
use super::NullBlkDevice;
|
||||
use kernel::{
|
||||
block::mq::gen_disk::{GenDisk, GenDiskBuilder},
|
||||
configfs::{self, AttributeOperations},
|
||||
|
|
|
|||
|
|
@ -875,13 +875,14 @@ fn as_ptr(&self) -> *const bindings::config_item_type {
|
|||
/// configfs::Subsystem<Configuration>,
|
||||
/// Configuration
|
||||
/// >::new_with_child_ctor::<N,Child>(
|
||||
/// &THIS_MODULE,
|
||||
/// ::kernel::module::this_module::<crate::LocalModule>(),
|
||||
/// &CONFIGURATION_ATTRS
|
||||
/// );
|
||||
///
|
||||
/// &CONFIGURATION_TPE
|
||||
/// }
|
||||
/// ```
|
||||
#[allow(clippy::crate_in_macro_def)]
|
||||
#[macro_export]
|
||||
macro_rules! configfs_attrs {
|
||||
(
|
||||
|
|
@ -1021,7 +1022,8 @@ macro_rules! configfs_attrs {
|
|||
|
||||
static [< $data:upper _TPE >] : $crate::configfs::ItemType<$container, $data> =
|
||||
$crate::configfs::ItemType::<$container, $data>::new::<N>(
|
||||
&THIS_MODULE, &[<$ data:upper _ATTRS >]
|
||||
$crate::module::this_module::<crate::LocalModule>(),
|
||||
&[<$ data:upper _ATTRS >]
|
||||
);
|
||||
)?
|
||||
|
||||
|
|
@ -1030,7 +1032,8 @@ macro_rules! configfs_attrs {
|
|||
$crate::configfs::ItemType<$container, $data> =
|
||||
$crate::configfs::ItemType::<$container, $data>::
|
||||
new_with_child_ctor::<N, $child>(
|
||||
&THIS_MODULE, &[<$ data:upper _ATTRS >]
|
||||
$crate::module::this_module::<crate::LocalModule>(),
|
||||
&[<$ data:upper _ATTRS >]
|
||||
);
|
||||
)?
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user