2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-15 16:53:54 +08:00

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>
This commit is contained in:
Dan Carpenter 2017-09-21 00:45:30 +03:00 committed by Alexandre Belloni
parent 695e38d881
commit 97f5b0379c

View File

@ -282,13 +282,13 @@ static int rv3029_eeprom_read(struct device *dev, u8 reg,
static int rv3029_eeprom_write(struct device *dev, u8 reg, static int rv3029_eeprom_write(struct device *dev, u8 reg,
u8 const buf[], size_t len) u8 const buf[], size_t len)
{ {
int ret, err; int ret;
size_t i; size_t i;
u8 tmp; u8 tmp;
err = rv3029_eeprom_enter(dev); ret = rv3029_eeprom_enter(dev);
if (err < 0) if (ret < 0)
return err; return ret;
for (i = 0; i < len; i++, reg++) { for (i = 0; i < len; i++, reg++) {
ret = rv3029_read_regs(dev, reg, &tmp, 1); ret = rv3029_read_regs(dev, reg, &tmp, 1);
@ -304,11 +304,11 @@ static int rv3029_eeprom_write(struct device *dev, u8 reg,
break; break;
} }
err = rv3029_eeprom_exit(dev); ret = rv3029_eeprom_exit(dev);
if (err < 0) if (ret < 0)
return err; return ret;
return ret; return 0;
} }
static int rv3029_eeprom_update_bits(struct device *dev, static int rv3029_eeprom_update_bits(struct device *dev,