Commit 765ee709 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

spi: dw: Convert to let spi core validate transfer speed

Set master->max_speed_hz then spi core will handle checking transfer speed.
So we can remove the same checking in this driver.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 794f61a3
...@@ -439,12 +439,6 @@ static void pump_transfers(unsigned long data) ...@@ -439,12 +439,6 @@ static void pump_transfers(unsigned long data)
if (transfer->speed_hz != speed) { if (transfer->speed_hz != speed) {
speed = transfer->speed_hz; speed = transfer->speed_hz;
if (speed > dws->max_freq) {
printk(KERN_ERR "MRST SPI0: unsupported"
"freq: %dHz\n", speed);
message->status = -EIO;
goto early_exit;
}
/* clk_div doesn't support odd number */ /* clk_div doesn't support odd number */
clk_div = dws->max_freq / speed; clk_div = dws->max_freq / speed;
...@@ -809,6 +803,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) ...@@ -809,6 +803,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
master->cleanup = dw_spi_cleanup; master->cleanup = dw_spi_cleanup;
master->setup = dw_spi_setup; master->setup = dw_spi_setup;
master->transfer = dw_spi_transfer; master->transfer = dw_spi_transfer;
master->max_speed_hz = dws->max_freq;
/* Basic HW init */ /* Basic HW init */
spi_hw_init(dws); spi_hw_init(dws);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment