[RFC PATCH 3/4] i2c: sh_mobile: use helper to decide if DMA is used

From: Wolfram Sang
Date: Tue Jun 06 2017 - 05:21:46 EST


This ensures also that we fall back to PIO if the buffer is not DMA
capable.

Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
---
drivers/i2c/busses/i2c-sh_mobile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 3d75593487454c..58e2ae3b4c4751 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -666,7 +666,7 @@ static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
pd->pos = -1;
pd->sr = 0;

- if (pd->msg->len > 8)
+ if (i2c_check_msg_for_dma(pd->msg, 8) == 0)
sh_mobile_i2c_xfer_dma(pd);

/* Enable all interrupts to begin with */
--
2.11.0