diff options
author | Arnd Bergmann <arnd@arndb.de> | 2015-11-16 15:04:52 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-18 14:19:20 -0800 |
commit | 5f550d930791b4b78f2c946060ee7cca3c03b113 (patch) | |
tree | 1ca6379186404d3b24df80cb08e995117dde6e14 /drivers/staging/wilc1000/wilc_spi.c | |
parent | d3ae4fa40088045b500f4d1ce85eb926b6cd2d3e (diff) | |
download | op-kernel-dev-5f550d930791b4b78f2c946060ee7cca3c03b113.zip op-kernel-dev-5f550d930791b4b78f2c946060ee7cca3c03b113.tar.gz |
staging/wilc1000: remove unused functions
A number of symbols in the wilc1000 driver are completely unused
and can be removed.
This includes two variables that are only written but not read.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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.c | 225 |
1 files changed, 0 insertions, 225 deletions
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c index 3741836..9af35d1 100644 --- a/drivers/staging/wilc1000/wilc_spi.c +++ b/drivers/staging/wilc1000/wilc_spi.c @@ -108,163 +108,6 @@ static u8 crc7(u8 crc, const u8 *buffer, u32 len) #define DATA_PKT_SZ_8K (8 * 1024) #define DATA_PKT_SZ DATA_PKT_SZ_8K -static int spi_cmd(u8 cmd, u32 adr, u32 data, u32 sz, u8 clockless) -{ - u8 bc[9]; - int len = 5; - int result = N_OK; - - bc[0] = cmd; - switch (cmd) { - case CMD_SINGLE_READ: /* single word (4 bytes) read */ - bc[1] = (u8)(adr >> 16); - bc[2] = (u8)(adr >> 8); - bc[3] = (u8)adr; - len = 5; - break; - - case CMD_INTERNAL_READ: /* internal register read */ - bc[1] = (u8)(adr >> 8); - if (clockless) - bc[1] |= BIT(7); - bc[2] = (u8)adr; - bc[3] = 0x00; - len = 5; - break; - - case CMD_TERMINATE: /* termination */ - bc[1] = 0x00; - bc[2] = 0x00; - bc[3] = 0x00; - len = 5; - break; - - case CMD_REPEAT: /* repeat */ - bc[1] = 0x00; - bc[2] = 0x00; - bc[3] = 0x00; - len = 5; - break; - - case CMD_RESET: /* reset */ - bc[1] = 0xff; - bc[2] = 0xff; - bc[3] = 0xff; - len = 5; - break; - - case CMD_DMA_WRITE: /* dma write */ - case CMD_DMA_READ: /* dma read */ - bc[1] = (u8)(adr >> 16); - bc[2] = (u8)(adr >> 8); - bc[3] = (u8)adr; - bc[4] = (u8)(sz >> 8); - bc[5] = (u8)(sz); - len = 7; - break; - - case CMD_DMA_EXT_WRITE: /* dma extended write */ - case CMD_DMA_EXT_READ: /* dma extended read */ - bc[1] = (u8)(adr >> 16); - bc[2] = (u8)(adr >> 8); - bc[3] = (u8)adr; - bc[4] = (u8)(sz >> 16); - bc[5] = (u8)(sz >> 8); - bc[6] = (u8)(sz); - len = 8; - break; - - case CMD_INTERNAL_WRITE: /* internal register write */ - bc[1] = (u8)(adr >> 8); - if (clockless) - bc[1] |= BIT(7); - bc[2] = (u8)(adr); - bc[3] = (u8)(data >> 24); - bc[4] = (u8)(data >> 16); - bc[5] = (u8)(data >> 8); - bc[6] = (u8)(data); - len = 8; - break; - - case CMD_SINGLE_WRITE: /* single word write */ - bc[1] = (u8)(adr >> 16); - bc[2] = (u8)(adr >> 8); - bc[3] = (u8)(adr); - bc[4] = (u8)(data >> 24); - bc[5] = (u8)(data >> 16); - bc[6] = (u8)(data >> 8); - bc[7] = (u8)(data); - len = 9; - break; - - default: - result = N_FAIL; - break; - } - - if (result) { - if (!g_spi.crc_off) - bc[len - 1] = (crc7(0x7f, (const u8 *)&bc[0], len - 1)) << 1; - else - len -= 1; - - if (!linux_spi_write(bc, len)) { - PRINT_ER("[wilc spi]: Failed cmd write, bus error...\n"); - result = N_FAIL; - } - } - - return result; -} - -static int spi_cmd_rsp(u8 cmd) -{ - u8 rsp; - int result = N_OK; - - /** - * Command/Control response - **/ - if ((cmd == CMD_RESET) || - (cmd == CMD_TERMINATE) || - (cmd == CMD_REPEAT)) { - if (!linux_spi_read(&rsp, 1)) { - result = N_FAIL; - goto _fail_; - } - } - - if (!linux_spi_read(&rsp, 1)) { - PRINT_ER("[wilc spi]: Failed cmd response read, bus error...\n"); - result = N_FAIL; - goto _fail_; - } - - if (rsp != cmd) { - PRINT_ER("[wilc spi]: Failed cmd response, cmd (%02x), resp (%02x)\n", cmd, rsp); - result = N_FAIL; - goto _fail_; - } - - /** - * State response - **/ - if (!linux_spi_read(&rsp, 1)) { - PRINT_ER("[wilc spi]: Failed cmd state read, bus error...\n"); - result = N_FAIL; - goto _fail_; - } - - if (rsp != 0x00) { - PRINT_ER("[wilc spi]: Failed cmd state response state (%02x)\n", rsp); - result = N_FAIL; - } - -_fail_: - - return result; -} - static int spi_cmd_complete(u8 cmd, u32 adr, u8 *b, u32 sz, u8 clockless) { u8 wb[32], rb[32]; @@ -604,74 +447,6 @@ _error_: return result; } -static int spi_data_read(u8 *b, u32 sz) -{ - int retry, ix, nbytes; - int result = N_OK; - u8 crc[2]; - u8 rsp; - - /** - * Data - **/ - ix = 0; - do { - if (sz <= DATA_PKT_SZ) - nbytes = sz; - else - nbytes = DATA_PKT_SZ; - - /** - * Data Respnose header - **/ - retry = 10; - do { - if (!linux_spi_read(&rsp, 1)) { - PRINT_ER("[wilc spi]: Failed data response read, bus error...\n"); - result = N_FAIL; - break; - } - if (((rsp >> 4) & 0xf) == 0xf) - break; - } while (retry--); - - if (result == N_FAIL) - break; - - if (retry <= 0) { - PRINT_ER("[wilc spi]: Failed data response read...(%02x)\n", rsp); - result = N_FAIL; - break; - } - - /** - * Read bytes - **/ - if (!linux_spi_read(&b[ix], nbytes)) { - PRINT_ER("[wilc spi]: Failed data block read, bus error...\n"); - result = N_FAIL; - break; - } - - /** - * Read Crc - **/ - if (!g_spi.crc_off) { - if (!linux_spi_read(crc, 2)) { - PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n"); - result = N_FAIL; - break; - } - } - - ix += nbytes; - sz -= nbytes; - - } while (sz); - - return result; -} - static int spi_data_write(u8 *b, u32 sz) { int ix, nbytes; |