Thread (18 messages) 18 messages, 4 authors, 2019-08-20

Re: [PATCH 3/6] net: stmmac: sun8i: Use devm_regulator_get for PHY regulator

From: Ondřej Jirman <hidden>
Date: 2019-08-20 15:56:53
Also in: linux-arm-kernel, linux-devicetree, lkml

On Tue, Aug 20, 2019 at 05:39:39PM +0200, Andrew Lunn wrote:
On Tue, Aug 20, 2019 at 04:53:40PM +0200, megous@megous.com wrote:
quoted
From: Ondrej Jirman <redacted>

Use devm_regulator_get instead of devm_regulator_get_optional and rely
on dummy supply. This avoids NULL checks before regulator_enable/disable
calls.
Hi Ondrej

What do you mean by a dummy supply? I'm just trying to make sure you
are not breaking backwards compatibility.
I have tested it on Orange Pi PC 2, that uses only phy-supply, but not
phy-io-supply, and the kernel now prints:

[    1.410137] dwmac-sun8i 1c30000.ethernet: 1c30000.ethernet supply phy-io not found, using dummy regulator

I have also tested it on Orange Pi PC, that doesn't use external phy, and
instead of:

[    1.081378] dwmac-sun8i 1c30000.ethernet: No regulator found

The kernel now prints:

[    1.112752] dwmac-sun8i 1c30000.ethernet: 1c30000.ethernet supply phy not found, using dummy regulator
[    1.112814] dwmac-sun8i 1c30000.ethernet: 1c30000.ethernet supply phy-io not found, using dummy regulator

Ethernet works in both cases, so that should cover all existing combinations. :)

regards,
	Ondrej

     Thanks
	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help