diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-11-12 18:10:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:27 -0500 |
commit | f16189aca0e2c6395e7fd6593c3a3063764c628d (patch) | |
tree | 8b972de16aba5afa57006f4fbab2eeec085539a6 | |
parent | c91fd91d686654f8afbbbca18f5ff0a6ebc9c7a2 (diff) |
drivers/rtc/rtc-max6900.c: remove redundant checks
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>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-max6900.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-max6900.c b/drivers/rtc/rtc-max6900.c index 55969b1b771a..4804985b876e 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) | |||
164 | 164 | ||
165 | static int max6900_i2c_clear_write_protect(struct i2c_client *client) | 165 | static int max6900_i2c_clear_write_protect(struct i2c_client *client) |
166 | { | 166 | { |
167 | int rc; | 167 | return i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0); |
168 | rc = i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0); | ||
169 | if (rc < 0) { | ||
170 | dev_err(&client->dev, "%s: control register write failed\n", | ||
171 | __func__); | ||
172 | return -EIO; | ||
173 | } | ||
174 | return 0; | ||
175 | } | 168 | } |
176 | 169 | ||
177 | static int | 170 | static int |