forked from len0rd/rockbox
usb_core: don't buffer control request unnecessarily
Due to how the old control request API worked, the request pointer (and the pointed-to contents) passed by the driver must remain valid for the lifetime of the request. The buffered copy wasn't used consistently anyway, so it should be safe to just get rid of it. (This only affects the old API compatibility layer.) Change-Id: I00294c718a7515a91b84f7c7cae5220c73aa5960
This commit is contained in:
parent
f8810be6de
commit
6e61e6f0c8
1 changed files with 1 additions and 3 deletions
|
@ -264,7 +264,6 @@ static struct usb_class_driver drivers[USB_NUM_DRIVERS] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USB_LEGACY_CONTROL_API
|
#ifdef USB_LEGACY_CONTROL_API
|
||||||
static struct usb_ctrlrequest active_request_buf;
|
|
||||||
static struct usb_ctrlrequest* volatile active_request = NULL;
|
static struct usb_ctrlrequest* volatile active_request = NULL;
|
||||||
static void* volatile control_write_data = NULL;
|
static void* volatile control_write_data = NULL;
|
||||||
static volatile bool control_write_data_done = false;
|
static volatile bool control_write_data_done = false;
|
||||||
|
@ -1020,8 +1019,7 @@ void usb_core_control_complete(int status)
|
||||||
/* Only needed if the driver does not support the new API yet */
|
/* Only needed if the driver does not support the new API yet */
|
||||||
void usb_core_legacy_control_request(struct usb_ctrlrequest* req)
|
void usb_core_legacy_control_request(struct usb_ctrlrequest* req)
|
||||||
{
|
{
|
||||||
memcpy(&active_request_buf, req, sizeof(*req));
|
active_request = req;
|
||||||
active_request = &active_request_buf;
|
|
||||||
control_write_data = NULL;
|
control_write_data = NULL;
|
||||||
control_write_data_done = false;
|
control_write_data_done = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue