Skip to content

Commit 0d8e7e2

Browse files
hoshinolinajannau
authored andcommitted
rust: init: Update documentation for new mutex init style
Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent f88691b commit 0d8e7e2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

rust/kernel/init.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//! }
4747
//!
4848
//! let foo = pin_init!(Foo {
49-
//! a <- new_mutex!(42, "Foo::a"),
49+
//! a <- Mutex::new_named(42, "Foo::a"),
5050
//! b: 24,
5151
//! });
5252
//! ```
@@ -65,7 +65,7 @@
6565
//! # b: u32,
6666
//! # }
6767
//! # let foo = pin_init!(Foo {
68-
//! # a <- new_mutex!(42, "Foo::a"),
68+
//! # a <- Mutex::new_named(42, "Foo::a"),
6969
//! # b: 24,
7070
//! # });
7171
//! let foo: Result<Pin<KBox<Foo>>> = KBox::pin_init(foo, GFP_KERNEL);
@@ -98,7 +98,7 @@
9898
//! impl DriverData {
9999
//! fn new() -> impl PinInit<Self, Error> {
100100
//! try_pin_init!(Self {
101-
//! status <- new_mutex!(0, "DriverData::status"),
101+
//! status <- Mutex::new_named(0, "DriverData::status"),
102102
//! buffer: KBox::init(kernel::init::zeroed(), GFP_KERNEL)?,
103103
//! })
104104
//! }
@@ -253,7 +253,7 @@ pub mod macros;
253253
/// }
254254
///
255255
/// stack_pin_init!(let foo = pin_init!(Foo {
256-
/// a <- new_mutex!(42),
256+
/// a <- Mutex::new(42),
257257
/// b: Bar {
258258
/// x: 64,
259259
/// },
@@ -313,7 +313,7 @@ macro_rules! stack_pin_init {
313313
/// }
314314
///
315315
/// stack_try_pin_init!(let foo: Result<Pin<&mut Foo>, AllocError> = pin_init!(Foo {
316-
/// a <- new_mutex!(42),
316+
/// a <- Mutex::new(42),
317317
/// b: KBox::new(Bar {
318318
/// x: 64,
319319
/// }, GFP_KERNEL)?,
@@ -347,7 +347,7 @@ macro_rules! stack_pin_init {
347347
/// }
348348
///
349349
/// stack_try_pin_init!(let foo: Pin<&mut Foo> =? pin_init!(Foo {
350-
/// a <- new_mutex!(42),
350+
/// a <- Mutex::new(42),
351351
/// b: KBox::new(Bar {
352352
/// x: 64,
353353
/// }, GFP_KERNEL)?,

0 commit comments

Comments
 (0)