aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/atm
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-04-28 02:00:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 13:03:31 -0400
commitfd05e720099e8eeddb378305d1a41c1445344b91 (patch)
treed617918be290b47b35822bc3cf21c8f01dde5dd2 /drivers/usb/atm
parent01d7b369887b6feb7c9ce2b20988fafe3f70841c (diff)
drivers/usb annotations and fixes
* endianness annotations * endianness fixes * missing get_unaligned/put_unaligned It's pretty much all over the place, changes to different files are independent. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Serial-parts-Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/atm')
-rw-r--r--drivers/usb/atm/cxacru.c12
-rw-r--r--drivers/usb/atm/ueagle-atm.c6
2 files changed, 10 insertions, 8 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++) {
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index abb7d7410e63..4220f22b6660 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -996,7 +996,7 @@ static void __uea_load_page_e4(struct uea_softc *sc, u8 pageno, int boot)
996 blockoffset = sc->dsp_firm->data + le32_to_cpu(blockidx->PageOffset); 996 blockoffset = sc->dsp_firm->data + le32_to_cpu(blockidx->PageOffset);
997 997
998 bi.dwSize = cpu_to_be32(blocksize); 998 bi.dwSize = cpu_to_be32(blocksize);
999 bi.dwAddress = swab32(blockidx->PageAddress); 999 bi.dwAddress = cpu_to_be32(le32_to_cpu(blockidx->PageAddress));
1000 1000
1001 uea_dbg(INS_TO_USBDEV(sc), 1001 uea_dbg(INS_TO_USBDEV(sc),
1002 "sending block %u for DSP page %u size %u address %x\n", 1002 "sending block %u for DSP page %u size %u address %x\n",
@@ -1040,7 +1040,7 @@ static void uea_load_page_e4(struct work_struct *work)
1040 return; 1040 return;
1041 1041
1042 p = (struct l1_code *) sc->dsp_firm->data; 1042 p = (struct l1_code *) sc->dsp_firm->data;
1043 if (pageno >= p->page_header[0].PageNumber) { 1043 if (pageno >= le16_to_cpu(p->page_header[0].PageNumber)) {
1044 uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n", pageno); 1044 uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n", pageno);
1045 return; 1045 return;
1046 } 1046 }
@@ -1065,7 +1065,7 @@ static void uea_load_page_e4(struct work_struct *work)
1065 bi.bPageNumber = 0xff; 1065 bi.bPageNumber = 0xff;
1066 bi.wReserved = cpu_to_be16(UEA_RESERVED); 1066 bi.wReserved = cpu_to_be16(UEA_RESERVED);
1067 bi.dwSize = cpu_to_be32(E4_PAGE_BYTES(p->page_header[0].PageSize)); 1067 bi.dwSize = cpu_to_be32(E4_PAGE_BYTES(p->page_header[0].PageSize));
1068 bi.dwAddress = swab32(p->page_header[0].PageAddress); 1068 bi.dwAddress = cpu_to_be32(le32_to_cpu(p->page_header[0].PageAddress));
1069 1069
1070 /* send block info through the IDMA pipe */ 1070 /* send block info through the IDMA pipe */
1071 if (uea_idma_write(sc, &bi, E4_BLOCK_INFO_SIZE)) 1071 if (uea_idma_write(sc, &bi, E4_BLOCK_INFO_SIZE))