Skip to content

Commit

Permalink
i2c: ismt: initialize DMA buffer
Browse files Browse the repository at this point in the history
This patch adds code to initialize the DMA buffer to compensate for
possible hardware data corruption.

Signed-off-by: James Ralston <[email protected]>
[wsa: changed to use 'sizeof']
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
jamesdralston authored and Wolfram Sang committed Sep 28, 2013
1 parent bd63ace commit bf41691
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/i2c/busses/i2c-ismt.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,

desc = &priv->hw[priv->head];

/* Initialize the DMA buffer */
memset(priv->dma_buffer, 0, sizeof(priv->dma_buffer));

/* Initialize the descriptor */
memset(desc, 0, sizeof(struct ismt_desc));
desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);
Expand Down

0 comments on commit bf41691

Please sign in to comment.