[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DG5G6NS0ZIPV.DGKUZ2J46AKX@kernel.org>
Date: Tue, 03 Feb 2026 16:55:44 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Matthew Maurer" <mmaurer@...gle.com>
Cc: "Bjorn Andersson" <andersson@...nel.org>, "Konrad Dybcio"
<konradybcio@...nel.org>, "Satya Durga Srinivasu Prabhala"
<satyap@...cinc.com>, "Miguel Ojeda" <ojeda@...nel.org>, "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>, "Daniel
Almeida" <daniel.almeida@...labora.com>, "Greg Kroah-Hartman"
<gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
"David Airlie" <airlied@...il.com>, "Simona Vetter" <simona@...ll.ch>,
"Michal Wilczynski" <m.wilczynski@...sung.com>, "Dave Ertman"
<david.m.ertman@...el.com>, "Ira Weiny" <ira.weiny@...el.com>, "Leon
Romanovsky" <leon@...nel.org>, "Trilok Soni" <tsoni@...cinc.com>,
<linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>, <driver-core@...ts.linux.dev>,
<dri-devel@...ts.freedesktop.org>, <linux-pwm@...r.kernel.org>
Subject: Re: [PATCH v2 4/6] rust: auxiliary: Support accessing raw aux
pointer
On Tue Feb 3, 2026 at 4:46 PM CET, Matthew Maurer wrote:
> While it's preferable to add bindings in the kernel crate rather than
> using raw pointers where possible, access to the raw aux pointer is
> required to pass it to C interfaces provided by a driver.
>
> Signed-off-by: Matthew Maurer <mmaurer@...gle.com>
> ---
> rust/kernel/auxiliary.rs | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/rust/kernel/auxiliary.rs b/rust/kernel/auxiliary.rs
> index 93c0db1f66555c97ec7dc58825e97c47c0154e54..1a88277f0fd9ea5ff32cc534dfe5682009de94c2 100644
> --- a/rust/kernel/auxiliary.rs
> +++ b/rust/kernel/auxiliary.rs
> @@ -237,7 +237,11 @@ pub struct Device<Ctx: device::DeviceContext = device::Normal>(
> );
>
> impl<Ctx: device::DeviceContext> Device<Ctx> {
> - fn as_raw(&self) -> *mut bindings::auxiliary_device {
> + /// Returns the underlying auxiliary device
"Returns a pointer to the underlying `struct auxiliary_device`."
> + ///
> + /// Prefer to add bindings in the kernel crate for any use other than calling driver-specific
> + /// functions.
I'm not sure I understand the message of this comment, but I'd probably just
drop it, the above should be enough.
> + pub fn as_raw(&self) -> *mut bindings::auxiliary_device {
> self.0.get()
> }
Powered by blists - more mailing lists