net: fec_mxc: Avoid enable regulator failure

Change to regulator_set_enable_if_allowed to avoid enable failure,
in case same phy supply shared by multiple FEC controllers.

Signed-off-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
Ye Li 2024-03-28 18:57:59 +08:00 committed by Fabio Estevam
parent 6cd789c7fd
commit 9dc7d5270b

View File

@ -1310,7 +1310,7 @@ static int fecmxc_probe(struct udevice *dev)
#ifdef CONFIG_DM_REGULATOR
if (priv->phy_supply) {
ret = regulator_set_enable(priv->phy_supply, true);
ret = regulator_set_enable_if_allowed(priv->phy_supply, true);
if (ret) {
printf("%s: Error enabling phy supply\n", dev->name);
return ret;