summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2014-09-13 18:03:05 +0200
committerMark Brown <broonie@kernel.org>2014-09-13 18:03:05 +0200
commit551f6a58d496a99702088ac762f247e04d8bfff9 (patch)
tree95610bb3eae95bd98d1c80bcd161be67c33a81f7 /drivers/spi/spi-dw.c
parentspi: dw-mid: remove FSF address and update copyright (diff)
parentspi: txx9: Fix checkpatch issue (diff)
downloadlinux-551f6a58d496a99702088ac762f247e04d8bfff9.tar.xz
linux-551f6a58d496a99702088ac762f247e04d8bfff9.zip
Merge branch 'topic/checkpatch' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-dw
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r--drivers/spi/spi-dw.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 6e55334c239a..fdb5a6d1c8c6 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -131,8 +131,7 @@ static int mrst_spi_debugfs_init(struct dw_spi *dws)
static void mrst_spi_debugfs_remove(struct dw_spi *dws)
{
- if (dws->debugfs)
- debugfs_remove_recursive(dws->debugfs);
+ debugfs_remove_recursive(dws->debugfs);
}
#else
@@ -173,7 +172,7 @@ static inline u32 rx_max(struct dw_spi *dws)
{
u32 rx_left = (dws->rx_end - dws->rx) / dws->n_bytes;
- return min(rx_left, (u32)dw_readw(dws, DW_SPI_RXFLR));
+ return min_t(u32, rx_left, dw_readw(dws, DW_SPI_RXFLR));
}
static void dw_writer(struct dw_spi *dws)
@@ -224,8 +223,9 @@ static void *next_transfer(struct dw_spi *dws)
struct spi_transfer,
transfer_list);
return RUNNING_STATE;
- } else
- return DONE_STATE;
+ }
+
+ return DONE_STATE;
}
/*
@@ -467,10 +467,12 @@ static void pump_transfers(unsigned long data)
*/
if (!dws->dma_mapped && !chip->poll_mode) {
int templen = dws->len / dws->n_bytes;
+
txint_level = dws->fifo_len / 2;
txint_level = (templen > txint_level) ? txint_level : templen;
- imask |= SPI_INT_TXEI | SPI_INT_TXOI | SPI_INT_RXUI | SPI_INT_RXOI;
+ imask |= SPI_INT_TXEI | SPI_INT_TXOI |
+ SPI_INT_RXUI | SPI_INT_RXOI;
dws->transfer_handler = interrupt_transfer;
}
@@ -511,7 +513,6 @@ static void pump_transfers(unsigned long data)
early_exit:
giveback(dws);
- return;
}
static int dw_spi_transfer_one_message(struct spi_master *master,
@@ -615,6 +616,7 @@ static void spi_hw_init(struct dw_spi *dws)
*/
if (!dws->fifo_len) {
u32 fifo;
+
for (fifo = 2; fifo <= 257; fifo++) {
dw_writew(dws, DW_SPI_TXFLTR, fifo);
if (fifo != dw_readw(dws, DW_SPI_TXFLTR))