diff options
author | John Rigby <john.rigby@linaro.org> | 2011-12-19 21:06:31 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2012-01-19 12:54:23 -0700 |
commit | bb84af5770eade047ee7bde6c7fde46e64fab71f (patch) | |
tree | 25ea881945a897447acb1123e7743b61ac2b367d | |
parent | aaaeaf93368728688072a50fb2b0c6375979ee5b (diff) |
USB: dsuboot.c Use accessors for accessing wMaxPacketSize
From ccfaf9408ec674efbfbc7a4cc1db7e6bdb839f1e where Tom Rini
fixes usbtty.c
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r-- | drivers/usb/gadget/dsuboot.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/gadget/dsuboot.c b/drivers/usb/gadget/dsuboot.c index 61fad3ebf..52da0abb5 100644 --- a/drivers/usb/gadget/dsuboot.c +++ b/drivers/usb/gadget/dsuboot.c @@ -21,6 +21,7 @@ #include <common.h> #include <command.h> +#include <asm/unaligned.h> #define CONFIG_USBD_MANUFACTURER "linaro" @@ -285,6 +286,9 @@ static int dsubt_init_strings(void) return 0; } +#define init_wMaxPacketSize(x) le16_to_cpu(get_unaligned(\ + &ep_descriptor_ptrs[(x) - 1]->wMaxPacketSize)); + static void dsubt_event_handler (struct usb_device_instance *device, usb_device_event_t event, int data) { @@ -378,14 +382,12 @@ static int dsubt_init_instances(void) endpoint_instance[i].rcv_attributes = ep_descriptor_ptrs[i - 1]->bmAttributes; - endpoint_instance[i].rcv_packetSize = - le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize); + endpoint_instance[i].rcv_packetSize = init_wMaxPacketSize(i); endpoint_instance[i].tx_attributes = ep_descriptor_ptrs[i - 1]->bmAttributes; - endpoint_instance[i].tx_packetSize = - le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize); + endpoint_instance[i].tx_packetSize = init_wMaxPacketSize(i); endpoint_instance[i].tx_attributes = ep_descriptor_ptrs[i - 1]->bmAttributes; |