Skip to content

Commit

Permalink
spi: dw: Convert to let spi core validate transfer speed
Browse files Browse the repository at this point in the history
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: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 3, 2014
1 parent 794f61a commit 765ee70
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/spi/spi-dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,6 @@ static void pump_transfers(unsigned long data)

if (transfer->speed_hz != speed) {
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 = dws->max_freq / speed;
Expand Down Expand Up @@ -809,6 +803,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
master->cleanup = dw_spi_cleanup;
master->setup = dw_spi_setup;
master->transfer = dw_spi_transfer;
master->max_speed_hz = dws->max_freq;

/* Basic HW init */
spi_hw_init(dws);
Expand Down

0 comments on commit 765ee70

Please sign in to comment.