@@ -1082,7 +1082,7 @@ static int bcm2835_spi_transfer_one(struct spi_controller *ctlr,
1082
1082
struct spi_transfer * tfr )
1083
1083
{
1084
1084
struct bcm2835_spi * bs = spi_controller_get_devdata (ctlr );
1085
- unsigned long spi_hz , clk_hz , cdiv , spi_used_hz ;
1085
+ unsigned long spi_hz , clk_hz , cdiv ;
1086
1086
unsigned long hz_per_byte , byte_limit ;
1087
1087
u32 cs = bs -> prepare_cs [spi -> chip_select ];
1088
1088
@@ -1102,7 +1102,7 @@ static int bcm2835_spi_transfer_one(struct spi_controller *ctlr,
1102
1102
} else {
1103
1103
cdiv = 0 ; /* 0 is the slowest we can go */
1104
1104
}
1105
- spi_used_hz = cdiv ? (clk_hz / cdiv ) : (clk_hz / 65536 );
1105
+ tfr -> effective_speed_hz = cdiv ? (clk_hz / cdiv ) : (clk_hz / 65536 );
1106
1106
bcm2835_wr (bs , BCM2835_SPI_CLK , cdiv );
1107
1107
1108
1108
/* handle all the 3-wire mode */
@@ -1122,7 +1122,7 @@ static int bcm2835_spi_transfer_one(struct spi_controller *ctlr,
1122
1122
* per 300,000 Hz of bus clock.
1123
1123
*/
1124
1124
hz_per_byte = polling_limit_us ? (9 * 1000000 ) / polling_limit_us : 0 ;
1125
- byte_limit = hz_per_byte ? spi_used_hz / hz_per_byte : 1 ;
1125
+ byte_limit = hz_per_byte ? tfr -> effective_speed_hz / hz_per_byte : 1 ;
1126
1126
1127
1127
/* run in polling mode for short transfers */
1128
1128
if (tfr -> len < byte_limit )
0 commit comments