Re: Re: [PATCH v2 0/3] Inline helpers into Rust without full LTO

From: Mark Brown

Date: Mon Mar 23 2026 - 09:55:04 EST


On Sun, Mar 22, 2026 at 08:38:30PM +0100, Miguel Ojeda wrote:

> - The docs on `regulator_get()` don't say it may return `NULL`. It
> originally that case, but commit be1a50d4eba4 ("regulator: Let
> drivers know when they use the stub API") changed that without
> changing the docs.

Callers should never treat NULL any differently to any other non-error
pointer, this is not a value intended for inspection by users.

> The original sentence (which still is there) says that nothing
> should look at the value, but then it goes onto say that drivers may
> actually look at the value.

Having specific handling for NULLs is very much not a preferred
interface, and most things shouldn't. The caller should probably have
it's own !CONFIG_REGULATOR checks rather than using the return value.

Attachment: signature.asc
Description: PGP signature