]> git.karo-electronics.de Git - karo-tx-linux.git/commit
i2c: at91: use correct length in dma_unmap_single()
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Jun 2015 05:49:23 +0000 (07:49 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Jun 2015 05:49:23 +0000 (07:49 +0200)
commit2332e9995a63f6825f7dcb043b5580e07f787213
treeb843b14287531130be2ed8ea87c4effb09093401
parent56c48cdeb160b2136fe2cd18b5d95ca30c85780e
i2c: at91: use correct length in dma_unmap_single()

The driver calls dma_map_single() with either 'dev->buf_len' or
'dev->buf_len - 2' as length argument, but always uses 'dev->buf_len'
in dma_unmap_single(). This produces the warning:
at91_i2c f8014000.i2c: DMA-API: device driver frees DMA memory with different size [device address=0x000000002fbf9240] [map size=20 bytes] [unmap size=22 bytes]
with CONFIG_DMA_API_DEBUG enabled.

Use dma_sg_len() as argument for dma_unmap_single() which is always
set to the correct length.
drivers/i2c/busses/i2c-at91.c