[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251110113528.1658238-2-ojeda@kernel.org>
Date: Mon, 10 Nov 2025 12:35:28 +0100
From: Miguel Ojeda <ojeda@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Brendan Higgins <brendan.higgins@...ux.dev>,
David Gow <davidgow@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>
Cc: Rae Moar <raemoar63@...il.com>,
linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
patches@...ts.linux.dev
Subject: [PATCH 2/2] rust: device: make example buildable
This example can easily be made buildable, thus do so.
It would have triggered an `unreachable_pub` warning without the previous
commit.
Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
---
rust/kernel/device.rs | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index a849b7dde2fd..d00f4af507db 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -67,7 +67,16 @@
///
/// A bus specific device should be defined as follows.
///
-/// ```ignore
+/// ```
+/// # use core::marker::PhantomData;
+/// # use kernel::{
+/// # device,
+/// # types::Opaque, //
+/// # };
+/// # mod bindings {
+/// # #[expect(non_camel_case_types)]
+/// # pub struct bus_device_type;
+/// # }
/// #[repr(transparent)]
/// pub struct Device<Ctx: device::DeviceContext = device::Normal>(
/// Opaque<bindings::bus_device_type>,
--
2.51.2
Powered by blists - more mailing lists