* [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function
@ 2022-03-13 8:18 Wolfgang Grandegger
2022-03-13 12:51 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2022-03-13 8:18 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Marek Vasut
dev_read_size() returns -EINVAL (-22) if the property "g-tx-fifo-size"
does not exist. If that's the case, we now keep the default value of 0.
Signed-off-by: Wolfgang Grandegger <wg@aries-embedded.de>
---
Changes since v1:
- removed unrelated changes (missing empty line)
- improved commit message
drivers/usb/gadget/dwc2_udc_otg.c | 5 +++--
1 file 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..12e91bb 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)
+ platdata->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) {
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function
2022-03-13 8:18 [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function Wolfgang Grandegger
@ 2022-03-13 12:51 ` Marek Vasut
2022-03-13 14:11 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2022-03-13 12:51 UTC (permalink / raw)
To: Wolfgang Grandegger, U-Boot Mailing List
On 3/13/22 09:18, Wolfgang Grandegger wrote:
> dev_read_size() returns -EINVAL (-22) if the property "g-tx-fifo-size"
> does not exist. If that's the case, we now keep the default value of 0.
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function
2022-03-13 12:51 ` Marek Vasut
@ 2022-03-13 14:11 ` Marek Vasut
2022-03-14 8:34 ` Wolfgang Grandegger
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2022-03-13 14:11 UTC (permalink / raw)
To: Wolfgang Grandegger, U-Boot Mailing List
On 3/13/22 13:51, Marek Vasut wrote:
> On 3/13/22 09:18, Wolfgang Grandegger wrote:
>> dev_read_size() returns -EINVAL (-22) if the property "g-tx-fifo-size"
>> does not exist. If that's the case, we now keep the default value of 0.
>
> Applied, thanks.
The patch does not even compile, please fix:
https://source.denx.de/u-boot/custodians/u-boot-usb/-/pipelines/11256
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function
2022-03-13 14:11 ` Marek Vasut
@ 2022-03-14 8:34 ` Wolfgang Grandegger
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Grandegger @ 2022-03-14 8:34 UTC (permalink / raw)
To: Marek Vasut, U-Boot Mailing List
Am 13.03.22 um 15:11 schrieb Marek Vasut:
> On 3/13/22 13:51, Marek Vasut wrote:
>> On 3/13/22 09:18, Wolfgang Grandegger wrote:
>>> dev_read_size() returns -EINVAL (-22) if the property "g-tx-fifo-size"
>>> does not exist. If that's the case, we now keep the default value of 0.
>>
>> Applied, thanks.
>
> The patch does not even compile, please fix:
>
> https://source.denx.de/u-boot/custodians/u-boot-usb/-/pipelines/11256
Argh, sorry, the patch was for v2020.v1, accidentally! I have just sent v3.
Thanks,
Wolfgang
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-14 8:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-13 8:18 [PATCH v2] usb: dwc2: handle return code of dev_read_size() in of to, plat function Wolfgang Grandegger
2022-03-13 12:51 ` Marek Vasut
2022-03-13 14:11 ` Marek Vasut
2022-03-14 8:34 ` Wolfgang Grandegger
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.