diff options
author | Sumit Semwal <sumit.semwal@linaro.org> | 2016-05-17 15:10:09 +0000 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-05-17 15:10:09 +0000 |
commit | 99e17f8a0421fd1958bdee92e7e66c22b89d9556 (patch) | |
tree | 15cacceadb018151ac80cd34c786cef5818d614d /drivers/net/wireless/ti/wlcore/spi.c | |
parent | 914edc40eafa0dabf561bf29c8e768a4b636e7f5 (diff) | |
parent | 08e85b5fa9b0d262c8d69709088ec7fbbab2ad28 (diff) |
Merge branch 'android-hikey-linaro-4.4' of https://android.googlesource.com/kernel/hikey-linaro into clang-4.4android-hikey-linaro-4.4-clang
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/spi.c')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/spi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index 236b41090827..44f059f7f34e 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -73,7 +73,10 @@ */ #define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) -#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) +/* Maximum number of SPI write chunks */ +#define WSPI_MAX_NUM_OF_CHUNKS \ + ((SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) + 1) + struct wl12xx_spi_glue { struct device *dev; @@ -268,9 +271,10 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr, void *buf, size_t len, bool fixed) { struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent); - struct spi_transfer t[2 * (WSPI_MAX_NUM_OF_CHUNKS + 1)]; + /* SPI write buffers - 2 for each chunk */ + struct spi_transfer t[2 * WSPI_MAX_NUM_OF_CHUNKS]; struct spi_message m; - u32 commands[WSPI_MAX_NUM_OF_CHUNKS]; + u32 commands[WSPI_MAX_NUM_OF_CHUNKS]; /* 1 command per chunk */ u32 *cmd; u32 chunk_len; int i; |