Re: [PATCH 4/4] regulator: core: make bulk API support optional supplies

From: Bjorn Andersson
Date: Mon Feb 06 2017 - 19:21:28 EST


On Fri 03 Feb 15:16 PST 2017, Dmitry Torokhov wrote:

> Make it possible to use the bulk API with optional supplies, by allowing
> the consumer to marking supplies as optional in the regulator_bulk_data.
>
> Based on earlier patch by Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxx>
>

Hi Dmitry,

Rather than fixing my broken patch, I reverted it after talking to Mark.
This as I realized that I got things backwards.

When a given component has an "optional" supply this can mean two
things:
1) The component has a supply pin that is connected, but the kernel has
no information about what it's connected to (in essence a "broken" DT).
In this case regulator_get() will return a dummy regulator.

2) The component has a supply pin that might or not might be connected
and depending on this the component needs to be configured differently.
In this case you use regulator_get_optional() which will return an error
in the event that no supply is specified.


With this in mind, supporting optional supplies in the bulk operations
makes less sense. (And after further review my case was a clear #1)

Regards,
Bjorn