From 45f82cde7cc1b85adbf6214452374b60d177e9e1 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 20 Feb 2020 11:01:08 +0100 Subject: 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 Signed-off-by: Sascha Hauer --- drivers/phy/phy-core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index d1f3c7fde4..ad1e814788 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; -- cgit v1.2.3