aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2011-03-30 11:09:53 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-03-30 23:31:48 -0400
commit8a33a373e5ffb6040c58ff41ea48ba21d5f8b5e9 (patch)
tree367a5267512482dc65d0a883156a8dcf0f2e596b /drivers/spi
parentde6efe0a966cf86b3c4039a610b2d4157db707f2 (diff)
spi/dw_spi: remove the un-necessary flush()
The flush() is used to drain all the left data in rx fifo, currently is is always called together with disabling hw. But from spec, disabling hw will also reset all the fifo, so flush() is not needed. Signed-off-by: Alek Du <alek.du@intel.com> Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-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,