diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-12 00:13:46 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-12 20:14:48 +0100 |
commit | 68792e2a1989bf34a9498356c3e3cc70b9231df2 (patch) | |
tree | ebb3edd0319b3399fee12563bb51cc941eb4aef5 /drivers/spi/spi-bcm63xx.c | |
parent | spi/bcm63xx: inline bcm63xx_spi_check_transfer (diff) | |
download | linux-68792e2a1989bf34a9498356c3e3cc70b9231df2.tar.xz linux-68792e2a1989bf34a9498356c3e3cc70b9231df2.zip |
spi/bcm63xx: inline hz usage in bcm63xx_spi_setup_transfer
bcm63xx_spi_setup_transfer is called from only one place, and that has
t always set, to hz will always be t->speed_hz - just use it directly in
the two places instead of moving it in a local variable.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-bcm63xx.c')
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index d777f6311100..2d64db4ac6a2 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -97,15 +97,12 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) { struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master); - u32 hz; u8 clk_cfg, reg; int i; - hz = (t) ? t->speed_hz : spi->max_speed_hz; - /* Find the closest clock configuration */ for (i = 0; i < SPI_CLK_MASK; i++) { - if (hz >= bcm63xx_spi_freq_table[i][0]) { + if (t->speed_hz >= bcm63xx_spi_freq_table[i][0]) { clk_cfg = bcm63xx_spi_freq_table[i][1]; break; } @@ -122,7 +119,7 @@ static void bcm63xx_spi_setup_transfer(struct spi_device *spi, bcm_spi_writeb(bs, reg, SPI_CLK_CFG); dev_dbg(&spi->dev, "Setting clock register to %02x (hz %d)\n", - clk_cfg, hz); + clk_cfg, t->speed_hz); } /* the spi->mode bits understood by this driver: */ |