mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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>
This commit is contained in:
parent
de6efe0a96
commit
8a33a373e5
@ -173,17 +173,6 @@ static void wait_till_not_busy(struct dw_spi *dws)
|
|||||||
"DW SPI: Status keeps busy for 5000us after a read/write!\n");
|
"DW SPI: Status keeps busy for 5000us after a read/write!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void flush(struct dw_spi *dws)
|
|
||||||
{
|
|
||||||
while (dw_readw(dws, sr) & SR_RF_NOT_EMPT) {
|
|
||||||
dw_readw(dws, dr);
|
|
||||||
cpu_relax();
|
|
||||||
}
|
|
||||||
|
|
||||||
wait_till_not_busy(dws);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int dw_writer(struct dw_spi *dws)
|
static int dw_writer(struct dw_spi *dws)
|
||||||
{
|
{
|
||||||
u16 txw = 0;
|
u16 txw = 0;
|
||||||
@ -297,8 +286,7 @@ static void giveback(struct dw_spi *dws)
|
|||||||
|
|
||||||
static void int_error_stop(struct dw_spi *dws, const char *msg)
|
static void int_error_stop(struct dw_spi *dws, const char *msg)
|
||||||
{
|
{
|
||||||
/* Stop and reset hw */
|
/* Stop the hw */
|
||||||
flush(dws);
|
|
||||||
spi_enable_chip(dws, 0);
|
spi_enable_chip(dws, 0);
|
||||||
|
|
||||||
dev_err(&dws->master->dev, "%s\n", msg);
|
dev_err(&dws->master->dev, "%s\n", msg);
|
||||||
@ -800,7 +788,6 @@ static void spi_hw_init(struct dw_spi *dws)
|
|||||||
spi_enable_chip(dws, 0);
|
spi_enable_chip(dws, 0);
|
||||||
spi_mask_intr(dws, 0xff);
|
spi_mask_intr(dws, 0xff);
|
||||||
spi_enable_chip(dws, 1);
|
spi_enable_chip(dws, 1);
|
||||||
flush(dws);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to detect the FIFO depth if not set by interface driver,
|
* Try to detect the FIFO depth if not set by interface driver,
|
||||||
|
Loading…
Reference in New Issue
Block a user