From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
mgr@pengutronix.de, rcz@pengutronix.de
Subject: [PATCH 3/6] phy: populate existing ->pwr member with phy-supply
Date: Thu, 20 Feb 2020 11:01:08 +0100 [thread overview]
Message-ID: <20200220100109.18147-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200220100109.18147-1-a.fatoum@pengutronix.de>
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>
---
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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2020-02-20 10:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 10:01 [PATCH 0/6] phy: usb: add support for STM32 usbphyc Ahmad Fatoum
2020-02-20 10:01 ` [PATCH 1/6] regulator: import Linux regulator_bulk API Ahmad Fatoum
2020-02-20 10:01 ` [PATCH 2/6] phy: remove unused init_data parameter Ahmad Fatoum
2020-02-20 10:01 ` Ahmad Fatoum [this message]
2020-02-20 10:01 ` [PATCH 4/6] phy: introduce phy_get_by_index Ahmad Fatoum
2020-02-20 10:01 ` [PATCH 5/6] regulator: port over Linux stm32 PWR regulator driver Ahmad Fatoum
2020-02-20 10:01 ` [PATCH 6/6] phy: port over Linux stm32 usbphyc driver Ahmad Fatoum
2020-02-25 8:11 ` [PATCH 0/6] phy: usb: add support for STM32 usbphyc Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200220100109.18147-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=mgr@pengutronix.de \
--cc=rcz@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox