diff options
| author | Evan Wilson <evan@oliodevices.com> | 2016-02-18 05:04:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@ip-172-31-25-77.us-west-1.compute.internal> | 2015-04-16 10:08:13 +0000 |
| commit | b2503a5c905f153564d2ff6c99ba9bd8dc32575c (patch) | |
| tree | 02f27a9a32dab59b76c441c3d660716a4562ee2a | |
| parent | 6e3548490c09c2abe1cf246a2f6569457d1930fe (diff) | |
| parent | 300fe054140b75c5a7bc3c53077b3c4c200e82b9 (diff) | |
| download | olio-linux-3.10-b2503a5c905f153564d2ff6c99ba9bd8dc32575c.tar.xz olio-linux-3.10-b2503a5c905f153564d2ff6c99ba9bd8dc32575c.zip | |
Merge "Making sure that the status never returns 0 in case of error (theoretical possibility earlier)." into android-3.10-bringup
| -rw-r--r-- | drivers/staging/triune/ts81001.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/triune/ts81001.c b/drivers/staging/triune/ts81001.c index ed6f8abc78f..85a56fe5b66 100644 --- a/drivers/staging/triune/ts81001.c +++ b/drivers/staging/triune/ts81001.c @@ -134,7 +134,10 @@ static int ts81001_write_i2c_blk(struct i2c_client * client, u8 reg_addr, * * This function reads the status from the device on the i2c bus. The * ts81001 can be really slow to react, so we'll try again a few times - * before accepting failure. + * before accepting failure. + * + * If we can't read a value, we return -1. This let's other parts of the + * system know that we failed to read status, and not change anything. */ static int ts81001_get_status (struct ts81001 * ts) { @@ -153,7 +156,7 @@ static int ts81001_get_status (struct ts81001 * ts) { if (err <= 0) { olio_debug ("Error reading status from ts81001, err = %d\n", err); - state = err; + state = -1; } else { state = (ts81001_state_t) data; break; |