Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176065
b: refs/heads/master
c: 147e084
h: refs/heads/master
i:
  176063: 08cf4db
v: v3
  • Loading branch information
Amit Kucheria authored and Samuel Ortiz committed Dec 13, 2009
1 parent 6233104 commit 2c0c170
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab4abe056d8828341d2a7d6463b13eafaf210181
refs/heads/master: 147e084792f22b52df65a3d9d0e8b2a9233e0aa8
30 changes: 22 additions & 8 deletions trunk/drivers/mfd/twl4030-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,17 @@ int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
ret = i2c_transfer(twl->client->adapter, twl->xfer_msg, 1);
mutex_unlock(&twl->xfer_lock);

/* i2cTransfer returns num messages.translate it pls.. */
if (ret >= 0)
ret = 0;
return ret;
/* i2c_transfer returns number of messages transferred */
if (ret != 1) {
pr_err("%s: i2c_write failed to transfer all messages\n",
DRIVER_NAME);
if (ret < 0)
return ret;
else
return -EIO;
} else {
return 0;
}
}
EXPORT_SYMBOL(twl4030_i2c_write);

Expand Down Expand Up @@ -358,10 +365,17 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
ret = i2c_transfer(twl->client->adapter, twl->xfer_msg, 2);
mutex_unlock(&twl->xfer_lock);

/* i2cTransfer returns num messages.translate it pls.. */
if (ret >= 0)
ret = 0;
return ret;
/* i2c_transfer returns number of messages transferred */
if (ret != 2) {
pr_err("%s: i2c_read failed to transfer all messages\n",
DRIVER_NAME);
if (ret < 0)
return ret;
else
return -EIO;
} else {
return 0;
}
}
EXPORT_SYMBOL(twl4030_i2c_read);

Expand Down

0 comments on commit 2c0c170

Please sign in to comment.