The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Markus Probst" <markus.probst@posteo.de>,
	"Danilo Krummrich" <dakr@kernel.org>,
	<gregkh@linuxfoundation.org>, <rafael@kernel.org>,
	<ojeda@kernel.org>, <boqun@kernel.org>, <gary@garyguo.net>,
	<bjorn3_gh@protonmail.com>, <lossin@kernel.org>,
	<a.hindborg@kernel.org>, <aliceryhl@google.com>,
	<tmgross@umich.edu>, <daniel.almeida@collabora.com>,
	<tamird@kernel.org>, <acourbot@nvidia.com>, <work@onurozkan.dev>
Cc: <driver-core@lists.linux.dev>, <linux-serial@vger.kernel.org>,
	<rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rust: serdev: use ThisModule::as_ptr() instead of field access
Date: Thu, 13 Aug 2026 17:08:32 +0100	[thread overview]
Message-ID: <DKNY2IJH29IL.7P64CPJFVGDC@garyguo.net> (raw)
In-Reply-To: <8e716c8ed7172fa28b569bf59a146c262a29e0c2.camel@posteo.de>

On Thu Aug 13, 2026 at 4:53 PM BST, Markus Probst wrote:
> On Thu, 2026-08-13 at 17:24 +0200, Danilo Krummrich wrote:
>> The THIS_MODULE series [1] applied to rust-next moved ThisModule from
>> lib.rs into a module.rs submodule, making the tuple struct field private
>> outside the module. This breaks the module.0 field access in serdev in
>> driver-core-next.
>> 
>> Update the call to __serdev_device_driver_register() to use the public
>> module.as_ptr() accessor to fix the build.
> I encounter 2 errors when building with both driver-core-next and rust-
> next
>
> error[E0616]: field `0` of struct `module::ThisModule` is private
>   --> rust/kernel/serdev.rs:90:89
>    |
> 90 |         to_result(unsafe {
> bindings::__serdev_device_driver_register(sdrv.get(), module.0) })
>    |                                                                  
> ^ private field
>
> error[E0599]: no method named `__pinned_init` found for associated type
> `impl pin_init::PinInit<<T as serdev::Driver>::Data<'_>, error::Error>
> + '_` in the current scope
>    --> rust/kernel/serdev.rs:200:40
>     |
> 200 |             let result = unsafe {
> data.__pinned_init(driver.as_mut_ptr()) };
>     |                                        ^^^^^^^^^^^^^ method not
> found in `impl pin_init::PinInit<<T as serdev::Driver>::Data<'_>,
> error::Error> + '_`
>
> error: aborting due to 2 previous errors
>
> [snip]
>
> Should I send a patch regarding the 2. error?
>
> It seems the `PinInit::__pinned_init` function is not only deprecated,
> but also behind the `#[cfg(not(kernel))]` flag, which causes the error.
>
> Thanks
> - Markus Probst

This is a semantic conflict that cannot be solved on a single tree and has to be
done on the merge commit.

A resolution is already on linux-next, see
https://lore.kernel.org/rust-for-linux/20260807074729.108159-1-ojeda@kernel.org/

Best,
Gary

  reply	other threads:[~2026-08-13 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 15:24 [PATCH] rust: serdev: use ThisModule::as_ptr() instead of field access Danilo Krummrich
2026-08-13 15:53 ` Markus Probst
2026-08-13 16:08   ` Gary Guo [this message]
2026-08-13 16:10   ` Danilo Krummrich
2026-08-13 16:08 ` Gary Guo
2026-08-13 23:20 ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DKNY2IJH29IL.7P64CPJFVGDC@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=markus.probst@posteo.de \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox