From: Weifeng Voon Date: Fri, 17 Jun 2016 01:46:35 +0000 (+0800) Subject: i2c: designware: Use transfer timeout from ioctl I2C_TIMEOUT X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d0bcd8df9aea2bcdbfcb074d408bdc7136031bc5;p=linux-beck.git i2c: designware: Use transfer timeout from ioctl I2C_TIMEOUT This allows applications to set the transfer timeout in 10ms increments via ioctl I2C_TIMEOUT. Signed-off-by: Weifeng Voon Acked-by: Jarkko Nikula Acked-by: Uwe Kleine-König Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index 99b54be6ba73..c6922b806fb7 100644 --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c @@ -663,7 +663,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) i2c_dw_xfer_init(dev); /* wait for tx to complete */ - if (!wait_for_completion_timeout(&dev->cmd_complete, HZ)) { + if (!wait_for_completion_timeout(&dev->cmd_complete, adap->timeout)) { dev_err(dev->dev, "controller timed out\n"); /* i2c_dw_init implicitly disables the adapter */ i2c_dw_init(dev);