summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_spi.c
diff options
context:
space:
mode:
authorGlen Lee <glen.lee@atmel.com>2015-12-21 14:18:08 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-21 13:20:04 -0800
commit9e6627ac727c0d8646085908d9d6c33c08390111 (patch)
tree44a5bd154d0b1918a72543723a9169d7146ad726 /drivers/staging/wilc1000/wilc_spi.c
parentb719302da6da3480e9086121f9c27362382c0efe (diff)
downloadop-kernel-dev-9e6627ac727c0d8646085908d9d6c33c08390111.zip
op-kernel-dev-9e6627ac727c0d8646085908d9d6c33c08390111.tar.gz
staging: wilc1000: use kernel define byte order macros
This patch removes define BIG_ENDIAN and use kernel define byte order macros instead of swap itself. Remove unused BYTE_SWAP macro and __CHECK_ENDIAN__ in Makefile also. Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_spi.c')
-rw-r--r--drivers/staging/wilc1000/wilc_spi.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index d6f4121..c94d86f 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -529,9 +529,7 @@ static int spi_internal_write(struct wilc *wilc, u32 adr, u32 dat)
{
int result;
-#ifdef BIG_ENDIAN
- dat = BYTE_SWAP(dat);
-#endif
+ dat = cpu_to_le32(dat);
result = spi_cmd_complete(wilc, CMD_INTERNAL_WRITE, adr, (u8 *)&dat, 4,
0);
if (result != N_OK) {
@@ -552,9 +550,7 @@ static int spi_internal_read(struct wilc *wilc, u32 adr, u32 *data)
return 0;
}
-#ifdef BIG_ENDIAN
- *data = BYTE_SWAP(*data);
-#endif
+ *data = cpu_to_le32(*data);
return 1;
}
@@ -571,9 +567,7 @@ static int wilc_spi_write_reg(struct wilc *wilc, u32 addr, u32 data)
u8 cmd = CMD_SINGLE_WRITE;
u8 clockless = 0;
-#ifdef BIG_ENDIAN
- data = BYTE_SWAP(data);
-#endif
+ data = cpu_to_le32(data);
if (addr < 0x30) {
/* Clockless register*/
cmd = CMD_INTERNAL_WRITE;
@@ -635,9 +629,7 @@ static int wilc_spi_read_reg(struct wilc *wilc, u32 addr, u32 *data)
return 0;
}
-#ifdef BIG_ENDIAN
- *data = BYTE_SWAP(*data);
-#endif
+ *data = cpu_to_le32(*data);
return 1;
}
OpenPOWER on IntegriCloud