diff mbox

[03/10] drivers/rtc/rtc-max6900.c: Remove redundant checks

Message ID 1378467223-26231-3-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Sept. 6, 2013, 11:33 a.m. UTC
i2c_smbus_write_byte_data() returns negative errno on failure or
0 on success. Return the value obtained from it directly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/rtc/rtc-max6900.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
diff mbox

Patch

diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c
index 55969b1..4804985 100644
--- a/drivers/rtc/rtc-max6900.c
+++ b/drivers/rtc/rtc-max6900.c
@@ -164,14 +164,7 @@  static int max6900_i2c_read_time(struct i2c_client *client, struct rtc_time *tm)
 
 static int max6900_i2c_clear_write_protect(struct i2c_client *client)
 {
-	int rc;
-	rc = i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0);
-	if (rc < 0) {
-		dev_err(&client->dev, "%s: control register write failed\n",
-			__func__);
-		return -EIO;
-	}
-	return 0;
+	return i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0);
 }
 
 static int