1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/usb/usbus/dfu: use container_of()

This commit is contained in:
Marian Buschsieweke 2021-12-02 16:02:48 +01:00
parent c67d86108e
commit d571f150ec
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -116,7 +116,7 @@ void usbus_dfu_init(usbus_t *usbus, usbus_dfu_device_t *handler, unsigned mode)
static void _init(usbus_t *usbus, usbus_handler_t *handler)
{
usbus_dfu_device_t *dfu = (usbus_dfu_device_t*) handler;
usbus_dfu_device_t *dfu = container_of(handler, usbus_dfu_device_t, handler_ctrl);
/* Set up descriptor generators */
dfu->dfu_descr.next = NULL;
dfu->dfu_descr.funcs = &_dfu_descriptor;
@ -257,7 +257,7 @@ static int _control_handler(usbus_t *usbus, usbus_handler_t *handler,
(void)usbus;
(void)state;
usbus_dfu_device_t *dfu = (usbus_dfu_device_t *)handler;
usbus_dfu_device_t *dfu = container_of(handler, usbus_dfu_device_t, handler_ctrl);
DEBUG("DFU: Request: 0x%x\n", setup->request);
/* Process DFU class request */