diff options
author | Tom Rini <trini@konsulko.com> | 2022-03-14 22:54:53 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-03-14 22:54:53 -0400 |
commit | 4dc9b1771b152838ddfc4ae86a0ab9fd53ea16f7 (patch) | |
tree | a9e5282cb4c6290f583ecceee3723bd72fe23ddf | |
parent | f43e892f51d7ecca8c8bd1b0850120db92f7caed (diff) | |
parent | 2addee35f2da178bf858403f2e2cb20a59df734f (diff) | |
download | u-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.c | 5 |
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) { |