aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-06-02 01:38:04 -0400
committerMark Brown <broonie@kernel.org>2017-06-06 14:48:23 -0400
commit2e312f6cdb02a2707870172473b9dee34f620b93 (patch)
tree53b5bbfe7277983bebdce57c516475c8ee4f41b0
parent65017ee2cd69bfd9ccdaa1f61b220e9717408106 (diff)
spi: imx: rename 'bpw' variables
'bpw' is ambiguous and only the context makes sure if bytes_per_word or bits_per_word is meant. Use the full names instead to make reading the code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-imx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 12e5ef7beb0b..e544f45348cc 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -200,27 +200,27 @@ out:
200 return i; 200 return i;
201} 201}
202 202
203static int spi_imx_bytes_per_word(const int bpw) 203static int spi_imx_bytes_per_word(const int bits_per_word)
204{ 204{
205 return DIV_ROUND_UP(bpw, BITS_PER_BYTE); 205 return DIV_ROUND_UP(bits_per_word, BITS_PER_BYTE);
206} 206}
207 207
208static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, 208static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,
209 struct spi_transfer *transfer) 209 struct spi_transfer *transfer)
210{ 210{
211 struct spi_imx_data *spi_imx = spi_master_get_devdata(master); 211 struct spi_imx_data *spi_imx = spi_master_get_devdata(master);
212 unsigned int bpw, i; 212 unsigned int bytes_per_word, i;
213 213
214 if (!master->dma_rx) 214 if (!master->dma_rx)
215 return false; 215 return false;
216 216
217 bpw = spi_imx_bytes_per_word(transfer->bits_per_word); 217 bytes_per_word = spi_imx_bytes_per_word(transfer->bits_per_word);
218 218
219 if (bpw != 1 && bpw != 2 && bpw != 4) 219 if (bytes_per_word != 1 && bytes_per_word != 2 && bytes_per_word != 4)
220 return false; 220 return false;
221 221
222 for (i = spi_imx_get_fifosize(spi_imx) / 2; i > 0; i--) { 222 for (i = spi_imx_get_fifosize(spi_imx) / 2; i > 0; i--) {
223 if (!(transfer->len % (i * bpw))) 223 if (!(transfer->len % (i * bytes_per_word)))
224 break; 224 break;
225 } 225 }
226 226