All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Michal Simek <michal.simek@xilinx.com>,
	Marek Vasut <marex@denx.de>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Angus Ainslie <angus@akkea.ca>,
	Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Simon Glass <sjg@chromium.org>
Subject: [PATCH] usb: dwc3: Fix non-usb3 configurations
Date: Mon, 25 Apr 2022 13:26:45 +0200	[thread overview]
Message-ID: <c5a71c30-e55d-c8ab-d372-e5aaa859cf2a@siemens.com> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

Missing nodes may also be signaled via -ENODATA. We need to check for
that to prevent failing in non-usb3 setups.

Furthermore, dev.phy must be NULL'ed in case usb3-phy was not found.

Fixes: 142d50fbce7c ("usb: dwc3: Add support for usb3-phy PHY configuration")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 drivers/usb/dwc3/dwc3-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 6e1a1d066b4..c5310e465cb 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -468,9 +468,11 @@ static int dwc3_glue_probe(struct udevice *dev)
 		ret = generic_phy_init(&phy);
 		if (ret)
 			return ret;
-	} else if (ret != -ENOENT) {
+	} else if (ret != -ENOENT && ret != -ENODATA) {
 		debug("could not get phy (err %d)\n", ret);
 		return ret;
+	} else {
+		phy.dev = NULL;
 	}
 
 	glue->regs = dev_read_addr(dev);
-- 
2.34.1

             reply	other threads:[~2022-04-25 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 11:26 Jan Kiszka [this message]
2022-04-25 11:29 ` [PATCH] usb: dwc3: Fix non-usb3 configurations Michal Simek

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=c5a71c30-e55d-c8ab-d372-e5aaa859cf2a@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=angus@akkea.ca \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=marex@denx.de \
    --cc=michal.simek@xilinx.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.