[PATCH 3/6] phy: populate existing ->pwr member with phy-supply

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/phy/phy-core.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index d1f3c7fde4a2..ad1e8147881b 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;
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux