diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2013-01-05 00:17:15 +0530 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-05 13:11:53 +0000 |
commit | beb96c2ad4cd5012e39587b960aa7e41661c78ca (patch) | |
tree | b4ca8fb93b305e5454fea912df0104e7a748876e /drivers/spi/spi-tegra20-slink.c | |
parent | 059b8ffeee5b427949872bb6ed5db5ae0788054e (diff) | |
download | blackbird-obmc-linux-beb96c2ad4cd5012e39587b960aa7e41661c78ca.tar.gz blackbird-obmc-linux-beb96c2ad4cd5012e39587b960aa7e41661c78ca.zip |
spi/tegra: remove checks for valid speed
SPI core make sure that all transfer has proper speed set
before calling low level spi transfer. Hence, it is not
require to have check in spi driver.
Remove the check for speed validity from transfer and use it directly.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-tegra20-slink.c')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index 7a95bddfb604..8d51db8dea6d 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c @@ -725,9 +725,7 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi, unsigned long command2; bits_per_word = t->bits_per_word; - speed = t->speed_hz ? t->speed_hz : spi->max_speed_hz; - if (!speed) - speed = tspi->spi_max_frequency; + speed = t->speed_hz; if (speed != tspi->cur_speed) { clk_set_rate(tspi->clk, speed * 4); tspi->cur_speed = speed; @@ -838,6 +836,8 @@ static int tegra_slink_setup(struct spi_device *spi) BUG_ON(spi->chip_select >= MAX_CHIP_SELECT); + /* Set speed to the spi max fequency if spi device has not set */ + spi->max_speed_hz = spi->max_speed_hz ? : tspi->spi_max_frequency; ret = pm_runtime_get_sync(tspi->dev); if (ret < 0) { dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); |