summaryrefslogtreecommitdiff
path: root/rust/kernel/init.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-07-29 16:38:46 +0100
committerGary Guo <gary@garyguo.net>2026-08-05 11:36:18 +0100
commitea7da3116015de801840f3e011dee907fb118f0c (patch)
tree0b091d682c38d30ba30c10f77029a507d19b8cc2 /rust/kernel/init.rs
parentd5492db2bf30b7e617e41d4fe3dba22475a1a354 (diff)
downloadlinux-next-ea7da3116015de801840f3e011dee907fb118f0c.tar.gz
linux-next-ea7da3116015de801840f3e011dee907fb118f0c.zip
rust: treewide: replace `__pinned_init` with `raw_[try_]init`
The `__init` method is not designed to be a public API (existence of "__" is a hint for this); replace users with `pin_init::raw_[try_]init` which does the same thing. There are a few users of `__init` which are replaced as well. Acked-by: Miguel Ojeda <ojeda@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260729-merge-init-v2-4-26adf47109e7@garyguo.net Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'rust/kernel/init.rs')
-rw-r--r--rust/kernel/init.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs
index 05a12e869a57..1fdc3963e3e3 100644
--- a/rust/kernel/init.rs
+++ b/rust/kernel/init.rs
@@ -158,7 +158,9 @@ pub trait InPlaceInit<T>: Sized {
{
// SAFETY: We delegate to `init` and only change the error type.
let init = unsafe {
- pin_init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e)))
+ pin_init_from_closure(|slot| {
+ pin_init::raw_try_init(slot, init).map_err(|e| Error::from(e))
+ })
};
Self::try_pin_init(init, flags)
}
@@ -176,7 +178,7 @@ pub trait InPlaceInit<T>: Sized {
{
// SAFETY: We delegate to `init` and only change the error type.
let init = unsafe {
- init_from_closure(|slot| init.__pinned_init(slot).map_err(|e| Error::from(e)))
+ init_from_closure(|slot| pin_init::raw_try_init(slot, init).map_err(|e| Error::from(e)))
};
Self::try_init(init, flags)
}