rust: init: consolidate init macros
authorBenno Lossin <benno.lossin@proton.me>
Mon, 14 Aug 2023 08:46:26 +0000 (08:46 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 21 Aug 2023 12:31:33 +0000 (14:31 +0200)
commitb3068ac37b1c10ee4b9fb6c07a2e46021376c374
tree12f66fe7d055c7515e8195eedd1f739dfac1df66
parent2285eb2f2429daadf9d57f08137b472139470aa9
rust: init: consolidate init macros

Merges the implementations of `try_init!` and `try_pin_init!`. These two
macros are very similar, but use different traits. The new macro
`__init_internal!` that is now the implementation for both takes these
traits as parameters.

This change does not affect any users, as no public API has been
changed, but it should simplify maintaining the init macros.

Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230814084602.25699-2-benno.lossin@proton.me
[ Cleaned a couple trivial nits. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/init.rs
rust/kernel/init/macros.rs