drivers: usb: handle a null output arg on SAM0
The output parameter `ret_bytes` is optional and may be NULL. Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
parent
aadcec16d9
commit
fe35269d12
1 changed files with 3 additions and 1 deletions
|
@ -562,7 +562,9 @@ int usb_dc_ep_write(uint8_t ep, const uint8_t *buf, uint32_t len, uint32_t *ret_
|
|||
USB_DEVICE_EPINTFLAG_TRCPT1 | USB_DEVICE_EPINTFLAG_TRFAIL1;
|
||||
endpoint->EPSTATUSSET.bit.BK1RDY = 1;
|
||||
|
||||
*ret_bytes = len;
|
||||
if (ret_bytes != NULL) {
|
||||
*ret_bytes = len;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue