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:
Michael Hope 2020-06-01 18:05:56 +02:00 committed by Carles Cufí
commit fe35269d12

View file

@ -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;
if (ret_bytes != NULL) {
*ret_bytes = len;
}
return 0;
}