summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-02-20 11:01:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-25 09:10:40 +0100
commit45f82cde7cc1b85adbf6214452374b60d177e9e1 (patch)
treefb4db1236d14be0734751b630dacad5b6c9ec1d4 /drivers
parentfa920fa5717b7b7e29cfc8eeb78c5057d860a3e6 (diff)
downloadbarebox-45f82cde7cc1b85adbf6214452374b60d177e9e1.tar.gz
phy: populate existing ->pwr member with phy-supply
barebox already enables/disables the ->pwr regulator at the correct places, but doesn't assign a value anywhere. Initialize it with the phy-supply regulator like Linux does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index d1f3c7f..ad1e814 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -51,6 +51,16 @@ struct phy *phy_create(struct device_d *dev, struct device_node *node,
phy->id = id;
phy->ops = ops;
+ /* phy-supply */
+ phy->pwr = regulator_get(&phy->dev, "phy");
+ if (IS_ERR(phy->pwr)) {
+ ret = PTR_ERR(phy->pwr);
+ if (ret == -EPROBE_DEFER)
+ goto free_ida;
+
+ phy->pwr = NULL;
+ }
+
ret = register_device(&phy->dev);
if (ret)
goto free_ida;