diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-02-09 10:15:21 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2015-03-15 10:54:09 +0100 |
commit | 913b1d85cdde5f1fc081aa84f548270a15027abb (patch) | |
tree | 063289e1cdbaea0801e223d702eba1c7a104e20a /drivers/i2c | |
parent | 1c42aca54fa0e738d9f0c0e5aa952d0e4357dcf0 (diff) | |
download | linux-stable-913b1d85cdde5f1fc081aa84f548270a15027abb.tar.gz linux-stable-913b1d85cdde5f1fc081aa84f548270a15027abb.tar.bz2 linux-stable-913b1d85cdde5f1fc081aa84f548270a15027abb.zip |
i2c: img-scb: fixup of wait_for_completion_timeout return handling
Return type of wait_for_completion_timeout is unsigned long not int.
Appropriately typed/named variable are added and assignment fixed up.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-img-scb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index 0fcc1694c607..00ffd6613680 100644 --- a/drivers/i2c/busses/i2c-img-scb.c +++ b/drivers/i2c/busses/i2c-img-scb.c @@ -988,15 +988,16 @@ out: static int img_i2c_reset_bus(struct img_i2c *i2c) { unsigned long flags; - int ret; + unsigned long time_left; spin_lock_irqsave(&i2c->lock, flags); reinit_completion(&i2c->msg_complete); img_i2c_reset_start(i2c); spin_unlock_irqrestore(&i2c->lock, flags); - ret = wait_for_completion_timeout(&i2c->msg_complete, IMG_I2C_TIMEOUT); - if (ret == 0) + time_left = wait_for_completion_timeout(&i2c->msg_complete, + IMG_I2C_TIMEOUT); + if (time_left == 0) return -ETIMEDOUT; return 0; } @@ -1007,6 +1008,7 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, struct img_i2c *i2c = i2c_get_adapdata(adap); bool atomic = false; int i, ret; + unsigned long time_left; if (i2c->mode == MODE_SUSPEND) { WARN(1, "refusing to service transaction in suspended state\n"); @@ -1068,11 +1070,11 @@ static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, img_i2c_write(i2c); spin_unlock_irqrestore(&i2c->lock, flags); - ret = wait_for_completion_timeout(&i2c->msg_complete, - IMG_I2C_TIMEOUT); + time_left = wait_for_completion_timeout(&i2c->msg_complete, + IMG_I2C_TIMEOUT); del_timer_sync(&i2c->check_timer); - if (ret == 0) { + if (time_left == 0) { dev_err(adap->dev.parent, "i2c transfer timed out\n"); i2c->msg_status = -ETIMEDOUT; break; |