From: "Nick Dowsett" <nick42d@gmail.com>
To: "Armin Wolf" <W_Armin@gmx.de>, "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>
Cc: <linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>,
<platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH v2 3/4] rust: wmi: add Driver trait, Adapter and implement RegistrationOps
Date: Sun, 29 Nov 2026 09:32:38 +0800 [thread overview]
Message-ID: <DN7B2PKZDT3G.1I3G9XA75R5O0@gmail.com> (raw)
In-Reply-To: <e622b541-49fd-48ce-87dd-62cb94f8f068@gmx.de>
Hi Armin,
Thanks for taking a look.
>> +// SAFETY: It's always valid to unregister a registered `wmi_driver`.
>> +unsafe impl<T: Driver> driver::RegistrationOps for Adapter<T> {
>> + unsafe fn register(
>> + reg: &Opaque<Self::DriverType>,
>> + name: &'static CStr,
>> + module: &'static ThisModule,
>> + ) -> Result {
>> + // SAFETY:
>> + // - It's safe to set the fields of `wmi_driver` on initialization.
>> + // - All set fields meet the invariants of `wmi_driver`.
>> + unsafe {
>> + // SAFETY: `name` is valid for the static lifetime.
>> + (*reg.get()).driver.name = name.as_char_ptr();
>
> Hi,
>
> can drivers set driver.probe_type = PROBE_PREFER_ASYNCHRONOUS? If no then please
> set it here is possible.
>
> Thanks,
> Armin Wolf
At the moment I didn't wrap `probe_type` from `driver.h` so drivers are
not able to set this themselves. If I can confirm it's OK to use
`PROBE_PREFER_ASYNCHRONOUS` for the reference Clevo driver are you OK if
this is hardcoded here for now? If a future consumer of the binding has
this requirement they could add a new associated const to `wmi::Driver`
defaulting to 'prefer asynchronous' in line with the recommendation from
the wmi subsystem docs.
Cheers Nick
next prev parent reply other threads:[~2026-11-29 1:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 11:02 [PATCH v2 0/4] rust: wmi: add ACPI WMI bus abstractions Nick Dowsett
2026-11-27 11:02 ` Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 1/4] rust: wmi: add basic WMI device abstraction Nick Dowsett
2026-11-27 11:02 ` Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 2/4] rust: wmi: add DeviceId and wmi_device_table! macro Nick Dowsett
2026-11-27 11:02 ` Nick Dowsett via B4 Relay
2026-11-27 11:02 ` [PATCH v2 3/4] rust: wmi: add Driver trait, Adapter and implement RegistrationOps Nick Dowsett
2026-11-27 11:02 ` Nick Dowsett via B4 Relay
2026-11-28 15:57 ` Armin Wolf
2026-11-29 1:32 ` Nick Dowsett [this message]
2026-11-27 11:02 ` [PATCH v2 4/4] rust: wmi: add Buffer and Device::invoke_method() Nick Dowsett
2026-11-27 11:02 ` Nick Dowsett via B4 Relay
2026-11-28 16:05 ` Armin Wolf
2026-11-29 3:08 ` Nick Dowsett
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=DN7B2PKZDT3G.1I3G9XA75R5O0@gmail.com \
--to=nick42d@gmail.com \
--cc=W_Armin@gmx.de \
--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=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=platform-driver-x86@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.