diff options
author | John Rigby <john.rigby@linaro.org> | 2011-12-19 21:06:31 -0700 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-12-19 21:19:16 -0700 |
commit | 5501921f21f01ddbe3984267d3b977e7f67168c6 (patch) | |
tree | 53655b2e470a49906e598a907ffa0e368b8a4ea5 | |
parent | fd45af542f887a2e2ac0c55d89387df7b28b8a70 (diff) | |
download | u-boot-linaro-stable-Linaro-u-boot-2011.12.tar.gz |
USB: dsuboot.c Use accessors for accessing wMaxPacketSize2011.12.2Linaro-u-boot-2011.12
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; |