diff mbox series

[v2] usb: dwc3: Handle case where setup_phy is not needed

Message ID fd79338ade4c9cb36b5919801a1cb421ef084605.1603282649.git.michal.simek@xilinx.com
State Accepted
Commit e7f9e1fca9b0563e5e83c5d2c5164bdda5948227
Delegated to: Marek Vasut
Headers show
Series [v2] usb: dwc3: Handle case where setup_phy is not needed | expand

Commit Message

Michal Simek Oct. 21, 2020, 12:17 p.m. UTC
From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

If CONFIG_PHY is not enabled then the dwc3_setup_phy()
returns ENOTSUPP which can be still valid and intentional
so modify error check to handle this -ENOTSUPP.

The same error handling exists in drivers/usb/host/xhci-dwc3.c already
added by commit d648a50c0a27 ("dwc3: move phy operation to core.c").

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- Extend commit message.

Link: https://lists.denx.de/pipermail/u-boot/2019-April/363535.html
      https://lists.denx.de/pipermail/u-boot/2019-June/371889.html

---
 drivers/usb/dwc3/dwc3-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut Oct. 21, 2020, 2:59 p.m. UTC | #1
On 10/21/20 2:17 PM, Michal Simek wrote:
> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> 
> If CONFIG_PHY is not enabled then the dwc3_setup_phy()
> returns ENOTSUPP which can be still valid and intentional
> so modify error check to handle this -ENOTSUPP.
> 
> The same error handling exists in drivers/usb/host/xhci-dwc3.c already
> added by commit d648a50c0a27 ("dwc3: move phy operation to core.c").

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 36fa16ad4e2e..a936f71d2e5d 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -74,7 +74,7 @@  static int dwc3_generic_probe(struct udevice *dev,
 	}
 
 	rc = dwc3_setup_phy(dev, &priv->phys);
-	if (rc)
+	if (rc && rc != -ENOTSUPP)
 		return rc;
 
 	if (device_is_compatible(dev->parent, "rockchip,rk3399-dwc3"))