aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-bitbang.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-12-18 03:55:43 -0500
committerGrant Likely <grant.likely@secretlab.ca>2013-02-05 07:26:59 -0500
commit766ed70447e0a9cfb23d068a4a929e18e54b0022 (patch)
tree95e426348573fd136fa4c7aeeeffb84143661e7a /drivers/spi/spi-bitbang.c
parentbb29785e0d6d150181704be2efcc3141044625e2 (diff)
spi: remove check for bits_per_word on transfer from low level driver
The spi core make sure that each transfer structure have the proper setting for bits_per_word before calling low level transfer APIs. Hence it is no more require to check again in low level driver for this field whether this is set correct or not. Removing such code from low level driver. The txx9 change also removes a test for bits_per_word set to 0, and forcing it to 8 in that case. This can also be removed now since spi_setup() ensures spi->bits_per_word is not zero. if (!spi->bits_per_word) spi->bits_per_word = 8; Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-bitbang.c')
-rw-r--r--drivers/spi/spi-bitbang.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c
index 8b3d8efafd3c..61beaec7cbed 100644
--- a/drivers/spi/spi-bitbang.c
+++ b/drivers/spi/spi-bitbang.c
@@ -69,7 +69,7 @@ static unsigned bitbang_txrx_8(
69 unsigned ns, 69 unsigned ns,
70 struct spi_transfer *t 70 struct spi_transfer *t
71) { 71) {
72 unsigned bits = t->bits_per_word ? : spi->bits_per_word; 72 unsigned bits = t->bits_per_word;
73 unsigned count = t->len; 73 unsigned count = t->len;
74 const u8 *tx = t->tx_buf; 74 const u8 *tx = t->tx_buf;
75 u8 *rx = t->rx_buf; 75 u8 *rx = t->rx_buf;
@@ -95,7 +95,7 @@ static unsigned bitbang_txrx_16(
95 unsigned ns, 95 unsigned ns,
96 struct spi_transfer *t 96 struct spi_transfer *t
97) { 97) {
98 unsigned bits = t->bits_per_word ? : spi->bits_per_word; 98 unsigned bits = t->bits_per_word;
99 unsigned count = t->len; 99 unsigned count = t->len;
100 const u16 *tx = t->tx_buf; 100 const u16 *tx = t->tx_buf;
101 u16 *rx = t->rx_buf; 101 u16 *rx = t->rx_buf;
@@ -121,7 +121,7 @@ static unsigned bitbang_txrx_32(
121 unsigned ns, 121 unsigned ns,
122 struct spi_transfer *t 122 struct spi_transfer *t
123) { 123) {
124 unsigned bits = t->bits_per_word ? : spi->bits_per_word; 124 unsigned bits = t->bits_per_word;
125 unsigned count = t->len; 125 unsigned count = t->len;
126 const u32 *tx = t->tx_buf; 126 const u32 *tx = t->tx_buf;
127 u32 *rx = t->rx_buf; 127 u32 *rx = t->rx_buf;