@@ -36,7 +36,7 @@
//!
//! ```rust
//! # #![allow(clippy::disallowed_names, clippy::new_ret_no_self)]
-//! use kernel::{prelude::*, sync::Mutex, new_mutex};
+//! use kernel::{prelude::*, sync::Mutex};
//! # use core::pin::Pin;
//! #[pin_data]
//! struct Foo {
@@ -46,7 +46,7 @@
//! }
//!
//! let foo = pin_init!(Foo {
-//! a <- new_mutex!(42, "Foo::a"),
+//! a <- Mutex::new_named(42, "Foo::a"),
//! b: 24,
//! });
//! ```
@@ -56,7 +56,7 @@
//!
//! ```rust
//! # #![allow(clippy::disallowed_names, clippy::new_ret_no_self)]
-//! # use kernel::{prelude::*, sync::Mutex, new_mutex};
+//! # use kernel::{prelude::*, sync::Mutex};
//! # use core::pin::Pin;
//! # #[pin_data]
//! # struct Foo {
@@ -65,7 +65,7 @@
//! # b: u32,
//! # }
//! # let foo = pin_init!(Foo {
-//! # a <- new_mutex!(42, "Foo::a"),
+//! # a <- Mutex::new_named(42, "Foo::a"),
//! # b: 24,
//! # });
//! let foo: Result<Pin<Box<Foo>>> = Box::pin_init(foo);
@@ -98,7 +98,7 @@
//! impl DriverData {
//! fn new() -> impl PinInit<Self, Error> {
//! try_pin_init!(Self {
-//! status <- new_mutex!(0, "DriverData::status"),
+//! status <- Mutex::new_named(0, "DriverData::status"),
//! buffer: Box::init(kernel::init::zeroed())?,
//! })
//! }
@@ -242,7 +242,7 @@
/// }
///
/// stack_pin_init!(let foo = pin_init!(Foo {
-/// a <- new_mutex!(42),
+/// a <- Mutex::new(42),
/// b: Bar {
/// x: 64,
/// },
@@ -294,7 +294,7 @@ macro_rules! stack_pin_init {
/// }
///
/// stack_try_pin_init!(let foo: Result<Pin<&mut Foo>, AllocError> = pin_init!(Foo {
-/// a <- new_mutex!(42),
+/// a <- Mutex::new(42),
/// b: Box::try_new(Bar {
/// x: 64,
/// })?,
@@ -320,7 +320,7 @@ macro_rules! stack_pin_init {
/// }
///
/// stack_try_pin_init!(let foo: Pin<&mut Foo> =? pin_init!(Foo {
-/// a <- new_mutex!(42),
+/// a <- Mutex::new(42),
/// b: Box::try_new(Bar {
/// x: 64,
/// })?,
Now that we have classless Mutex creation, update the docs to reflect the new API. Signed-off-by: Asahi Lina <lina@asahilina.net> --- rust/kernel/init.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)