@@ -345,7 +345,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
345
345
struct spi_transfer * tfr )
346
346
{
347
347
struct bcm2835aux_spi * bs = spi_master_get_devdata (master );
348
- unsigned long spi_hz , clk_hz , speed , spi_used_hz ;
348
+ unsigned long spi_hz , clk_hz , speed ;
349
349
unsigned long hz_per_byte , byte_limit ;
350
350
351
351
/* calculate the registers to handle
@@ -374,7 +374,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
374
374
/* set the new speed */
375
375
bs -> cntl [0 ] |= speed << BCM2835_AUX_SPI_CNTL0_SPEED_SHIFT ;
376
376
377
- spi_used_hz = clk_hz / (2 * (speed + 1 ));
377
+ tfr -> effective_speed_hz = clk_hz / (2 * (speed + 1 ));
378
378
379
379
/* set transmit buffers and length */
380
380
bs -> tx_buf = tfr -> tx_buf ;
@@ -391,7 +391,7 @@ static int bcm2835aux_spi_transfer_one(struct spi_master *master,
391
391
* 30 µs per 300,000 Hz of bus clock.
392
392
*/
393
393
hz_per_byte = polling_limit_us ? (9 * 1000000 ) / polling_limit_us : 0 ;
394
- byte_limit = hz_per_byte ? spi_used_hz / hz_per_byte : 1 ;
394
+ byte_limit = hz_per_byte ? tfr -> effective_speed_hz / hz_per_byte : 1 ;
395
395
396
396
/* run in polling mode for short transfers */
397
397
if (tfr -> len < byte_limit )
0 commit comments