aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-03-14 22:54:53 -0400
committerTom Rini <trini@konsulko.com>2022-03-14 22:54:53 -0400
commit4dc9b1771b152838ddfc4ae86a0ab9fd53ea16f7 (patch)
treea9e5282cb4c6290f583ecceee3723bd72fe23ddf
parentf43e892f51d7ecca8c8bd1b0850120db92f7caed (diff)
parent2addee35f2da178bf858403f2e2cb20a59df734f (diff)
downloadu-boot-WIP/14Mar2022.zip
u-boot-WIP/14Mar2022.tar.gz
u-boot-WIP/14Mar2022.tar.bz2
Merge https://source.denx.de/u-boot/custodians/u-boot-usbWIP/14Mar2022
- Bugfix for dwc2 USB driver.
-rw-r--r--drivers/usb/gadget/dwc2_udc_otg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index 2748270..77988f7 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -996,8 +996,9 @@ static int dwc2_udc_otg_of_to_plat(struct udevice *dev)
plat->rx_fifo_sz = dev_read_u32_default(dev, "g-rx-fifo-size", 0);
plat->np_tx_fifo_sz = dev_read_u32_default(dev, "g-np-tx-fifo-size", 0);
- plat->tx_fifo_sz_nb =
- dev_read_size(dev, "g-tx-fifo-size") / sizeof(u32);
+ ret = dev_read_size(dev, "g-tx-fifo-size");
+ if (ret > 0)
+ plat->tx_fifo_sz_nb = ret / sizeof(u32);
if (plat->tx_fifo_sz_nb > DWC2_MAX_HW_ENDPOINTS)
plat->tx_fifo_sz_nb = DWC2_MAX_HW_ENDPOINTS;
if (plat->tx_fifo_sz_nb) {