Skip to contentSkip to conversation

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

PATCH Applied Axel Lin 2 participants 2 messages Feb 20, 2014 – Mar 3, 2014 SPI

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/spi/spi-dw.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/spi/spi-dw.c +1 -6
index bf98d63..9e4a0aa 100644
@@ -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;
@@ -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);
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#1 lore raw
Quoted 2 lines · Axel Lin

Set master->max_speed_hz then spi core will handle checking transfer speed. So we can remove the same checking in this driver.

Applied, thanks.