diff mbox

[v2] i2c: designware: Use transfer timeout from ioctl I2C_TIMEOUT

Message ID 1465980946-20895-1-git-send-email-weifeng.voon@intel.com
State Superseded
Headers show

Commit Message

Voon, Weifeng June 15, 2016, 8:55 a.m. UTC
This allows applications to set the transfer timeout in 10ms increments via
ioctl I2C_TIMEOUT.

changelog v2:
* No code change, just change to a more suitable title

Signed-off-by: Weifeng Voon <weifeng.voon@intel.com>
---
 drivers/i2c/busses/i2c-designware-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jarkko Nikula June 15, 2016, 1:50 p.m. UTC | #1
On 06/15/2016 11:55 AM, Weifeng Voon wrote:
> This allows applications to set the transfer timeout in 10ms increments via
> ioctl I2C_TIMEOUT.
>
> changelog v2:
> * No code change, just change to a more suitable title
>
> Signed-off-by: Weifeng Voon <weifeng.voon@intel.com>
> ---
>  drivers/i2c/busses/i2c-designware-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
Actually changelog doesn't belong to commit log. Otherwise

Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 99b54be..c6922b8 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);