Re: [PATCH net-next v1 2/2] net: dsa: realtek: rtl83xx: add support for enabling supplies

From: Ahmad Fatoum

Date: Fri Aug 07 2026 - 10:32:05 EST


Hello Mark,

On 8/7/26 2:19 PM, Mark Brown wrote:
> On Fri, Aug 07, 2026 at 10:27:31AM +0200, Ahmad Fatoum wrote:
>
>> Anyways, circling back to the patch: Any objections to leave it as-is
>> and suppress the warnings in this particular driver?
>
> Yes, that is a buggy use of regulator_get_optional() so you should not
> do that.

If the DT binding documents a regulator as optional, it makes no sense
to me that the driver implementing the binding triggers a warning when
the optional regulator is omitted.

> Unless the supply may be physically absent it should not be
> used. If you have ideas for how to safely improve the implementation of
> the normal regulator_get() then it'd be better to do that, bearing in
> mind that it's an API where getting things wrong can easily result in
> physical damange to the system.

How about demoting the dummy supply warning to notice? I think this
better reflects the severity of the message.

Cheers,
Ahmad




--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |