Re: [PATCH] rust: regulator: do not assume that regulator_get() returns non-null

From: Miguel Ojeda

Date: Tue Mar 24 2026 - 09:45:36 EST


On Tue, Mar 24, 2026 at 11:50 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> Fix this by using a raw pointer `*mut bindings::regulator` instead of
> `NonNull`. This allows `inner` to be `NULL` when `CONFIG_REGULATOR` is
> disabled, and leverages the C stubs which are designed to handle `NULL`
> or are no-ops.

Yeah, matching the transparency of the C API is what we should
generally do, so unless there is a reason not to do it here (and
Daniel already replied, so I guess not), this looks good.

Liam, Mark: I guess you will pick this up, but if not, please let me
know -- thanks!

Cheers,
Miguel