aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/dw_spi.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c
index c4fca3d9d45f..d3aaf8db86cc 100644
--- a/drivers/spi/dw_spi.c
+++ b/drivers/spi/dw_spi.c
@@ -173,17 +173,6 @@ static void wait_till_not_busy(struct dw_spi *dws)
173 "DW SPI: Status keeps busy for 5000us after a read/write!\n"); 173 "DW SPI: Status keeps busy for 5000us after a read/write!\n");
174} 174}
175 175
176static void flush(struct dw_spi *dws)
177{
178 while (dw_readw(dws, sr) & SR_RF_NOT_EMPT) {
179 dw_readw(dws, dr);
180 cpu_relax();
181 }
182
183 wait_till_not_busy(dws);
184}
185
186
187static int dw_writer(struct dw_spi *dws) 176static int dw_writer(struct dw_spi *dws)
188{ 177{
189 u16 txw = 0; 178 u16 txw = 0;
@@ -297,8 +286,7 @@ static void giveback(struct dw_spi *dws)
297 286
298static void int_error_stop(struct dw_spi *dws, const char *msg) 287static void int_error_stop(struct dw_spi *dws, const char *msg)
299{ 288{
300 /* Stop and reset hw */ 289 /* Stop the hw */
301 flush(dws);
302 spi_enable_chip(dws, 0); 290 spi_enable_chip(dws, 0);
303 291
304 dev_err(&dws->master->dev, "%s\n", msg); 292 dev_err(&dws->master->dev, "%s\n", msg);
@@ -800,7 +788,6 @@ static void spi_hw_init(struct dw_spi *dws)
800 spi_enable_chip(dws, 0); 788 spi_enable_chip(dws, 0);
801 spi_mask_intr(dws, 0xff); 789 spi_mask_intr(dws, 0xff);
802 spi_enable_chip(dws, 1); 790 spi_enable_chip(dws, 1);
803 flush(dws);
804 791
805 /* 792 /*
806 * Try to detect the FIFO depth if not set by interface driver, 793 * Try to detect the FIFO depth if not set by interface driver,