diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-09-21 00:45:30 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-10-12 17:24:19 +0300 |
commit | 97f5b0379c382d9c2b944baa02852338dee7d8aa (patch) | |
tree | 7991417d68ff4ca36d85f7be0f119098e237e8c8 | |
parent | 695e38d8818dd858d7516c77bab96be266f56694 (diff) | |
download | linux-97f5b0379c382d9c2b944baa02852338dee7d8aa.tar.xz |
rtc: rv3029: Clean up error handling in rv3029_eeprom_write()
We don't need both "ret" and "err" when they do the same thing. All the
functions called here return zero on success or negative error codes.
It's more clear to return a literal zero at the end instead of
"return ret;"
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-rv3029c2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c index cfe3aece51d1..3d6174eb32f6 100644 --- a/drivers/rtc/rtc-rv3029c2.c +++ b/drivers/rtc/rtc-rv3029c2.c @@ -282,13 +282,13 @@ static int rv3029_eeprom_read(struct device *dev, u8 reg, static int rv3029_eeprom_write(struct device *dev, u8 reg, u8 const buf[], size_t len) { - int ret, err; + int ret; size_t i; u8 tmp; - err = rv3029_eeprom_enter(dev); - if (err < 0) - return err; + ret = rv3029_eeprom_enter(dev); + if (ret < 0) + return ret; for (i = 0; i < len; i++, reg++) { ret = rv3029_read_regs(dev, reg, &tmp, 1); @@ -304,11 +304,11 @@ static int rv3029_eeprom_write(struct device *dev, u8 reg, break; } - err = rv3029_eeprom_exit(dev); - if (err < 0) - return err; + ret = rv3029_eeprom_exit(dev); + if (ret < 0) + return ret; - return ret; + return 0; } static int rv3029_eeprom_update_bits(struct device *dev, |