From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B880190462; Tue, 3 Feb 2026 15:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770134151; cv=none; b=eZqEwI5lerxhRIvjQ51lH5WkqkBjAiGZfdu6T7Z+ibJ6ybQn+wusgCpWzYAR+pQoq+zN5moU4aE3vhQXzVnlXkofJqOYEmRDC8yEzA2Cugaox93nP3Tl6n3iIjm6xCIYc9sf/JvNw/7CHGFc7CrbJidcG7WmB37k53gwepr8NP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770134151; c=relaxed/simple; bh=/xUQRy0cArdh67xxYz8tNs4qAGoDCFuISO6r7tmdMFw=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=jn7IWnAGKhFOa9plz3vv9eUnTsAX6Odr7mjC8MP25L/WKfKUd46DF29mF1UCHIXTKXYuOZXCTJxfmsIiv/AQwoS97D9/tEHh24cakEGEMvuCPsAwnm5FtqNSbcenQl8y/WysCOTLOwaXIXpaI2nX3598e/22zchK/5GvXlKLAI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Le/RAiAz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Le/RAiAz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01758C116D0; Tue, 3 Feb 2026 15:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770134151; bh=/xUQRy0cArdh67xxYz8tNs4qAGoDCFuISO6r7tmdMFw=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=Le/RAiAzYp3Wea57YnAAv1R5gQs+iT5aAIy60KbhXOIGj66crsbNB1WcWKjR880yN TwBegG2uib0bt+bwRoetTp1PNLVmOIdsJTGVmAhgcqz325wX5aRJS9JCLiBvUG+XnT GCyJChVCdBnEYrV+rRLw5BkNp2hlTW0NGa5+MaUtlSC5EYU1ZKQYnjkCa3m2UDJlmP iVxdMNMogm6MLpcrJpdq71lWHj3At4J1GGOn9y/TKXdUm+U+ktytK9+ZLclR7JQaRq PfOm4lb6ikMdH7VK1J3avjgOZll86HW9FcvNp8oQdtHixFHE3wQtqaTUQl2icyHyWe Ksmzgq+oyqGvA== Precedence: bulk X-Mailing-List: linux-pwm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 03 Feb 2026 16:55:44 +0100 Message-Id: Subject: Re: [PATCH v2 4/6] rust: auxiliary: Support accessing raw aux pointer Cc: "Bjorn Andersson" , "Konrad Dybcio" , "Satya Durga Srinivasu Prabhala" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Daniel Almeida" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "David Airlie" , "Simona Vetter" , "Michal Wilczynski" , "Dave Ertman" , "Ira Weiny" , "Leon Romanovsky" , "Trilok Soni" , , , , , , To: "Matthew Maurer" From: "Danilo Krummrich" References: <20260203-qcom-socinfo-v2-0-d6719db85637@google.com> <20260203-qcom-socinfo-v2-4-d6719db85637@google.com> In-Reply-To: <20260203-qcom-socinfo-v2-4-d6719db85637@google.com> 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 > --- > 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..1a88277f0fd9ea5ff32cc534d= fe5682009de94c2 100644 > --- a/rust/kernel/auxiliary.rs > +++ b/rust/kernel/auxiliary.rs > @@ -237,7 +237,11 @@ pub struct Device( > ); > =20 > impl Device { > - 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 tha= n calling driver-specific > + /// functions. I'm not sure I understand the message of this comment, but I'd probably jus= t drop it, the above should be enough. > + pub fn as_raw(&self) -> *mut bindings::auxiliary_device { > self.0.get() > }