From: Roger Quadros <rogerq@kernel.org>
To: nm@ti.com, robertcnelson@gmail.com, trini@konsulko.com, marex@denx.de
Cc: n-francis@ti.com, praneeth@ti.com, s-vadapalli@ti.com,
r-gunasekaran@ti.com, srk@ti.com, vigneshr@ti.com,
u-boot@lists.denx.de, Roger Quadros <rogerq@kernel.org>
Subject: [PATCH 2/5] usb: cdns3: avoid error messages if phys don't exist
Date: Fri, 12 Jan 2024 14:49:48 +0200 [thread overview]
Message-ID: <20240112124951.238098-3-rogerq@kernel.org> (raw)
In-Reply-To: <20240112124951.238098-1-rogerq@kernel.org>
The phys property is optional so don't complain
if it doesn't exist in device tree.
Signed-off-by: Roger Quadros <rogerq@kernel.org>
---
drivers/usb/cdns3/core.c | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 644a9791b9..12a741c6ea 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -333,20 +333,28 @@ static int cdns3_probe(struct cdns3 *cdns)
mutex_init(&cdns->mutex);
ret = generic_phy_get_by_name(dev, "cdns3,usb2-phy", &cdns->usb2_phy);
- if (ret)
- dev_warn(dev, "Unable to get USB2 phy (ret %d)\n", ret);
-
- ret = generic_phy_init(&cdns->usb2_phy);
- if (ret)
+ if (!ret) {
+ ret = generic_phy_init(&cdns->usb2_phy);
+ if (ret) {
+ dev_err(dev, "USB2 PHY init failed: %d\n", ret);
+ return ret;
+ }
+ } else if (ret != -ENOENT && ret != -ENODATA) {
+ dev_err(dev, "Couldn't get USB2 PHY: %d\n", ret);
return ret;
+ }
ret = generic_phy_get_by_name(dev, "cdns3,usb3-phy", &cdns->usb3_phy);
- if (ret)
- dev_warn(dev, "Unable to get USB3 phy (ret %d)\n", ret);
-
- ret = generic_phy_init(&cdns->usb3_phy);
- if (ret)
+ if (!ret) {
+ ret = generic_phy_init(&cdns->usb3_phy);
+ if (ret) {
+ dev_err(dev, "USB3 PHY init failed: %d\n", ret);
+ return ret;
+ }
+ } else if (ret != -ENOENT && ret != -ENODATA) {
+ dev_err(dev, "Couldn't get USB3 PHY: %d\n", ret);
return ret;
+ }
ret = generic_phy_power_on(&cdns->usb2_phy);
if (ret)
--
2.34.1
next prev parent reply other threads:[~2024-01-12 12:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 12:49 [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Roger Quadros
2024-01-12 12:49 ` [PATCH 1/5] board: ti: j721e: Drop SERDES PHY init from board file Roger Quadros
2024-01-12 12:49 ` Roger Quadros [this message]
2024-01-12 12:49 ` [PATCH 3/5] arm: dts: k3-j721e: Fix USB0 operation Roger Quadros
2024-01-12 12:49 ` [PATCH 4/5] arm: dts: k3-j721e-beagleboneai64: Fix USB operation Roger Quadros
2024-01-12 13:02 ` Nishanth Menon
2024-01-12 13:06 ` Roger Quadros
2024-01-12 13:14 ` Nishanth Menon
2024-01-12 13:21 ` Tom Rini
2024-01-15 11:40 ` Roger Quadros
2024-01-20 16:50 ` Tom Rini
2024-01-22 11:39 ` Roger Quadros
2024-01-22 16:00 ` Tom Rini
2024-01-12 12:49 ` [PATCH 5/5] configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY Roger Quadros
2024-01-20 21:04 ` [PATCH 0/5] k3-j721e: beagleboneai: Fix USB Tom Rini
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=20240112124951.238098-3-rogerq@kernel.org \
--to=rogerq@kernel.org \
--cc=marex@denx.de \
--cc=n-francis@ti.com \
--cc=nm@ti.com \
--cc=praneeth@ti.com \
--cc=r-gunasekaran@ti.com \
--cc=robertcnelson@gmail.com \
--cc=s-vadapalli@ti.com \
--cc=srk@ti.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=vigneshr@ti.com \
/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