diff options
author | Marek Vasut <marex@denx.de> | 2012-11-18 00:25:07 -0500 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-11-22 17:03:34 -0500 |
commit | 958f9889950ef257f601c4902137caff291d5dd7 (patch) | |
tree | e7feaa68cd2a814384ec7d01a7f0bf6f89a3ccd5 /drivers | |
parent | 963f2076e3b4d62e219b3fa60de7b50e335f5783 (diff) |
i2c: mxs: Handle i2c DMA failure properly
Properly terminate the DMA transfer in case the DMA PIO transfer
or setup fails for any reason.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 286ca1917820..0670da79ee5e 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -287,12 +287,14 @@ read_init_dma_fail: | |||
287 | select_init_dma_fail: | 287 | select_init_dma_fail: |
288 | dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE); | 288 | dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE); |
289 | select_init_pio_fail: | 289 | select_init_pio_fail: |
290 | dmaengine_terminate_all(i2c->dmach); | ||
290 | return -EINVAL; | 291 | return -EINVAL; |
291 | 292 | ||
292 | /* Write failpath. */ | 293 | /* Write failpath. */ |
293 | write_init_dma_fail: | 294 | write_init_dma_fail: |
294 | dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE); | 295 | dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE); |
295 | write_init_pio_fail: | 296 | write_init_pio_fail: |
297 | dmaengine_terminate_all(i2c->dmach); | ||
296 | return -EINVAL; | 298 | return -EINVAL; |
297 | } | 299 | } |
298 | 300 | ||