diff options
-rw-r--r-- | drivers/spi/spi-rockchip.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 1a777dc261d6..25003c408c92 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c | |||
@@ -302,8 +302,8 @@ static int rockchip_spi_prepare_message(struct spi_master *master, | |||
302 | return 0; | 302 | return 0; |
303 | } | 303 | } |
304 | 304 | ||
305 | static int rockchip_spi_unprepare_message(struct spi_master *master, | 305 | static void rockchip_spi_handle_err(struct spi_master *master, |
306 | struct spi_message *msg) | 306 | struct spi_message *msg) |
307 | { | 307 | { |
308 | unsigned long flags; | 308 | unsigned long flags; |
309 | struct rockchip_spi *rs = spi_master_get_devdata(master); | 309 | struct rockchip_spi *rs = spi_master_get_devdata(master); |
@@ -313,8 +313,8 @@ static int rockchip_spi_unprepare_message(struct spi_master *master, | |||
313 | /* | 313 | /* |
314 | * For DMA mode, we need terminate DMA channel and flush | 314 | * For DMA mode, we need terminate DMA channel and flush |
315 | * fifo for the next transfer if DMA thansfer timeout. | 315 | * fifo for the next transfer if DMA thansfer timeout. |
316 | * unprepare_message() was called by core if transfer complete | 316 | * handle_err() was called by core if transfer failed. |
317 | * or timeout. Maybe it is reasonable for error handling here. | 317 | * Maybe it is reasonable for error handling here. |
318 | */ | 318 | */ |
319 | if (rs->use_dma) { | 319 | if (rs->use_dma) { |
320 | if (rs->state & RXBUSY) { | 320 | if (rs->state & RXBUSY) { |
@@ -327,6 +327,12 @@ static int rockchip_spi_unprepare_message(struct spi_master *master, | |||
327 | } | 327 | } |
328 | 328 | ||
329 | spin_unlock_irqrestore(&rs->lock, flags); | 329 | spin_unlock_irqrestore(&rs->lock, flags); |
330 | } | ||
331 | |||
332 | static int rockchip_spi_unprepare_message(struct spi_master *master, | ||
333 | struct spi_message *msg) | ||
334 | { | ||
335 | struct rockchip_spi *rs = spi_master_get_devdata(master); | ||
330 | 336 | ||
331 | spi_enable_chip(rs, 0); | 337 | spi_enable_chip(rs, 0); |
332 | 338 | ||
@@ -688,6 +694,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) | |||
688 | master->prepare_message = rockchip_spi_prepare_message; | 694 | master->prepare_message = rockchip_spi_prepare_message; |
689 | master->unprepare_message = rockchip_spi_unprepare_message; | 695 | master->unprepare_message = rockchip_spi_unprepare_message; |
690 | master->transfer_one = rockchip_spi_transfer_one; | 696 | master->transfer_one = rockchip_spi_transfer_one; |
697 | master->handle_err = rockchip_spi_handle_err; | ||
691 | 698 | ||
692 | rs->dma_tx.ch = dma_request_slave_channel(rs->dev, "tx"); | 699 | rs->dma_tx.ch = dma_request_slave_channel(rs->dev, "tx"); |
693 | if (!rs->dma_tx.ch) | 700 | if (!rs->dma_tx.ch) |