Patchwork [02/10] drivers/rtc/rtc-isl1208.c: Remove redundant checks

login
register
mail settings
Submitter Sachin Kamat
Date Sept. 6, 2013, 11:33 a.m.
Message ID <1378467223-26231-2-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/273154/
State New
Headers show

Comments

Sachin Kamat - Sept. 6, 2013, 11:33 a.m.
i2c_smbus_read_byte_data() returns negative errno on failure.
Return the value obtained from it directly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Herbert Valerio Riedel <hvr@gnu.org>
---
 drivers/rtc/rtc-isl1208.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Patch

diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index c016ad8..5a0bf7c 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -144,11 +144,7 @@  isl1208_i2c_validate_client(struct i2c_client *client)
 static int
 isl1208_i2c_get_sr(struct i2c_client *client)
 {
-	int sr = i2c_smbus_read_byte_data(client, ISL1208_REG_SR);
-	if (sr < 0)
-		return -EIO;
-
-	return sr;
+	return i2c_smbus_read_byte_data(client, ISL1208_REG_SR);
 }
 
 static int