aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm/cxacru.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/atm/cxacru.c')
-rw-r--r--drivers/usb/atm/cxacru.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index d470c72b737e..5ea3093bc40f 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -38,6 +38,7 @@
38#include <linux/device.h> 38#include <linux/device.h>
39#include <linux/firmware.h> 39#include <linux/firmware.h>
40#include <linux/mutex.h> 40#include <linux/mutex.h>
41#include <asm/unaligned.h>
41 42
42#include "usbatm.h" 43#include "usbatm.h"
43 44
@@ -573,7 +574,7 @@ static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_requ
573 u32 *data, int size) 574 u32 *data, int size)
574{ 575{
575 int ret, len; 576 int ret, len;
576 u32 *buf; 577 __le32 *buf;
577 int offb, offd; 578 int offb, offd;
578 const int stride = CMD_PACKET_SIZE / (4 * 2) - 1; 579 const int stride = CMD_PACKET_SIZE / (4 * 2) - 1;
579 int buflen = ((size - 1) / stride + 1 + size * 2) * 4; 580 int buflen = ((size - 1) / stride + 1 + size * 2) * 4;
@@ -837,7 +838,7 @@ static int cxacru_fw(struct usb_device *usb_dev, enum cxacru_fw_request fw,
837 buf[offb++] = l; 838 buf[offb++] = l;
838 buf[offb++] = code1; 839 buf[offb++] = code1;
839 buf[offb++] = code2; 840 buf[offb++] = code2;
840 *((u32 *) (buf + offb)) = cpu_to_le32(addr); 841 put_unaligned(cpu_to_le32(addr), (__le32 *)(buf + offb));
841 offb += 4; 842 offb += 4;
842 addr += l; 843 addr += l;
843 if(l) 844 if(l)
@@ -874,8 +875,9 @@ static void cxacru_upload_firmware(struct cxacru_data *instance,
874 int off; 875 int off;
875 struct usbatm_data *usbatm = instance->usbatm; 876 struct usbatm_data *usbatm = instance->usbatm;
876 struct usb_device *usb_dev = usbatm->usb_dev; 877 struct usb_device *usb_dev = usbatm->usb_dev;
877 u16 signature[] = { usb_dev->descriptor.idVendor, usb_dev->descriptor.idProduct }; 878 __le16 signature[] = { usb_dev->descriptor.idVendor,
878 u32 val; 879 usb_dev->descriptor.idProduct };
880 __le32 val;
879 881
880 dbg("cxacru_upload_firmware"); 882 dbg("cxacru_upload_firmware");
881 883
@@ -955,7 +957,7 @@ static void cxacru_upload_firmware(struct cxacru_data *instance,
955 /* Load config data (le32), doing one packet at a time */ 957 /* Load config data (le32), doing one packet at a time */
956 if (cf) 958 if (cf)
957 for (off = 0; off < cf->size / 4; ) { 959 for (off = 0; off < cf->size / 4; ) {
958 u32 buf[CMD_PACKET_SIZE / 4 - 1]; 960 __le32 buf[CMD_PACKET_SIZE / 4 - 1];
959 int i, len = min_t(int, cf->size / 4 - off, CMD_PACKET_SIZE / 4 / 2 - 1); 961 int i, len = min_t(int, cf->size / 4 - off, CMD_PACKET_SIZE / 4 / 2 - 1);
960 buf[0] = cpu_to_le32(len); 962 buf[0] = cpu_to_le32(len);
961 for (i = 0; i < len; i++, off++) { 963 for (i = 0; i < len; i++, off++) {