mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-17 15:14:35 +08:00
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>
This commit is contained in:
parent
963f2076e3
commit
958f988995
@ -287,12 +287,14 @@ read_init_dma_fail:
|
||||
select_init_dma_fail:
|
||||
dma_unmap_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE);
|
||||
select_init_pio_fail:
|
||||
dmaengine_terminate_all(i2c->dmach);
|
||||
return -EINVAL;
|
||||
|
||||
/* Write failpath. */
|
||||
write_init_dma_fail:
|
||||
dma_unmap_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE);
|
||||
write_init_pio_fail:
|
||||
dmaengine_terminate_all(i2c->dmach);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user