aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-06-07 14:44:05 -0400
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-06-25 19:26:16 -0400
commitcde0fe2acd7cf6f76e926d4e2ce14439681fd5be (patch)
tree69524dbc563c263ab8349382d708c02baebb6342
parentd6faca40f40b62aca8ea8c29289c7bf7456172bb (diff)
rtc: rv8803: broaden workaround
The previous workaround may still fail as there are actually 4 retries to be done to ensure the communication succeed. Also, some I2C adapter drivers may return -EIO instead of -ENXIO. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r--drivers/rtc/rtc-rv8803.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index f623038e586e..022ef26bef47 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -68,7 +68,7 @@ static irqreturn_t rv8803_handle_irq(int irq, void *dev_id)
68 do { 68 do {
69 flags = i2c_smbus_read_byte_data(client, RV8803_FLAG); 69 flags = i2c_smbus_read_byte_data(client, RV8803_FLAG);
70 try++; 70 try++;
71 } while ((flags == -ENXIO) && (try < 3)); 71 } while (((flags == -ENXIO) || (flags == -EIO)) && (try < 4));
72 if (flags <= 0) { 72 if (flags <= 0) {
73 mutex_unlock(&rv8803->flags_lock); 73 mutex_unlock(&rv8803->flags_lock);
74 return IRQ_NONE; 74 return IRQ_NONE;
@@ -452,7 +452,7 @@ static int rv8803_probe(struct i2c_client *client,
452 do { 452 do {
453 flags = i2c_smbus_read_byte_data(client, RV8803_FLAG); 453 flags = i2c_smbus_read_byte_data(client, RV8803_FLAG);
454 try++; 454 try++;
455 } while ((flags == -ENXIO) && (try < 3)); 455 } while (((flags == -ENXIO) || (flags == -EIO)) && (try < 4));
456 456
457 if (flags < 0) 457 if (flags < 0)
458 return flags; 458 return flags;
@@ -493,7 +493,7 @@ static int rv8803_probe(struct i2c_client *client,
493 err = i2c_smbus_write_byte_data(rv8803->client, RV8803_EXT, 493 err = i2c_smbus_write_byte_data(rv8803->client, RV8803_EXT,
494 RV8803_EXT_WADA); 494 RV8803_EXT_WADA);
495 try++; 495 try++;
496 } while ((err == -ENXIO) && (try < 3)); 496 } while (((err == -ENXIO) || (flags == -EIO)) && (try < 4));
497 if (err) 497 if (err)
498 return err; 498 return err;
499 499