aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-tegra20-slink.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-tegra20-slink.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-tegra20-slink.c')
-rw-r--r--drivers/spi/spi-tegra20-slink.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 651167f2e0af..7a95bddfb604 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -284,8 +284,7 @@ static unsigned tegra_slink_calculate_curr_xfer_param(
284 unsigned max_len; 284 unsigned max_len;
285 unsigned total_fifo_words; 285 unsigned total_fifo_words;
286 286
287 bits_per_word = t->bits_per_word ? t->bits_per_word : 287 bits_per_word = t->bits_per_word;
288 spi->bits_per_word;
289 tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1; 288 tspi->bytes_per_word = (bits_per_word - 1) / 8 + 1;
290 289
291 if (bits_per_word == 8 || bits_per_word == 16) { 290 if (bits_per_word == 8 || bits_per_word == 16) {
@@ -378,8 +377,7 @@ static unsigned int tegra_slink_read_rx_fifo_to_client_rxbuf(
378 } else { 377 } else {
379 unsigned int bits_per_word; 378 unsigned int bits_per_word;
380 379
381 bits_per_word = t->bits_per_word ? t->bits_per_word : 380 bits_per_word = t->bits_per_word;
382 tspi->cur_spi->bits_per_word;
383 for (count = 0; count < rx_full_count; count++) { 381 for (count = 0; count < rx_full_count; count++) {
384 x = tegra_slink_readl(tspi, SLINK_RX_FIFO); 382 x = tegra_slink_readl(tspi, SLINK_RX_FIFO);
385 for (i = 0; (i < tspi->bytes_per_word); i++) 383 for (i = 0; (i < tspi->bytes_per_word); i++)
@@ -444,8 +442,7 @@ static void tegra_slink_copy_spi_rxbuf_to_client_rxbuf(
444 unsigned int x; 442 unsigned int x;
445 unsigned int rx_mask, bits_per_word; 443 unsigned int rx_mask, bits_per_word;
446 444
447 bits_per_word = t->bits_per_word ? t->bits_per_word : 445 bits_per_word = t->bits_per_word;
448 tspi->cur_spi->bits_per_word;
449 rx_mask = (1 << bits_per_word) - 1; 446 rx_mask = (1 << bits_per_word) - 1;
450 for (count = 0; count < tspi->curr_dma_words; count++) { 447 for (count = 0; count < tspi->curr_dma_words; count++) {
451 x = tspi->rx_dma_buf[count]; 448 x = tspi->rx_dma_buf[count];