net: dm: fec: Fix regulator enable when using DM_REGULATOR
authorAdam Ford <aford173@gmail.com>
Tue, 15 Jan 2019 17:26:48 +0000 (11:26 -0600)
committerStefano Babic <sbabic@denx.de>
Fri, 15 Feb 2019 11:41:12 +0000 (12:41 +0100)
When DM_REGULATOR is enabled, the driver attempts to call
regulator_autoset() which expects the regulators to be on at boot
and/or always on and fails if they are not true.
For a more generic approach, this patch just calls
regulator_set_enable() which shouldn't have such restrictions.

Fixes: ad8c43cbcafb ("net: dm: fec: Support the phy-supply
binding")

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Martin Fuzzey <martin.fuzzey@flowbird.group>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/fec_mxc.c

index 1a59026a62f82032a24438fd3fcea03428ada85b..a14fe43a5b0aff1907fb29b5b8132201780bf306 100644 (file)
@@ -1348,7 +1348,7 @@ static int fecmxc_probe(struct udevice *dev)
 
 #ifdef CONFIG_DM_REGULATOR
        if (priv->phy_supply) {
-               ret = regulator_autoset(priv->phy_supply);
+               ret = regulator_set_enable(priv->phy_supply, true);
                if (ret) {
                        printf("%s: Error enabling phy supply\n", dev->name);
                        return ret;