Re: [PATCH v3 2/3] iio: light: gp2ap002: add led power supply

From: chr[]

Date: Wed Nov 04 2026 - 08:06:58 EST


Hi Andy,

Thanks for the review.
I'm about pretty up this patch. My comment on this:

Am 21.10.26 um 10:29 schrieb Andy Shevchenko:
> On Tue, Oct 20, 2026 at 01:35:39PM +0200, Christoph Rudorff wrote:
>
> ...
>
>> ret = gp2ap002_init(gp2ap002);
>> if (ret) {
>> dev_err(dev, "initialization failed\n");
>> - goto out_disable_vio;
>> + goto out_disable_power;
>> }
>> pm_runtime_get_noresume(dev);
>> pm_runtime_set_active(dev);
>> @@ -616,10 +619,8 @@ static int gp2ap002_probe(struct i2c_client *client)
>> pm_runtime_put_noidle(dev);
>> out_disable_pm:
>> pm_runtime_disable(dev);
>> -out_disable_vio:
>> - regulator_disable(gp2ap002->vio);
>> -out_disable_vdd:
>> - regulator_disable(gp2ap002->vdd);
>> +out_disable_power:
>> + regulator_bulk_disable(NUM_SUPPLIES, gp2ap002->supplies);
>> return ret;
>
> Wondering if we can use managed resources to disable regulators.
>

Well, me too. But there is just one way to make devres bulk_disable: use devm_regulator_bulk_get_enable() but we want to set voltages before enabling.

With Best Regards,
chris