rtc: rv3029: revert error handling patch to rv3029_eeprom_write()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 17 Aug 2019 06:56:04 +0000 (09:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:06 +0000 (14:51 +0100)
commitae0929cf973fada3cb8c1db00d6c752be0070cce
tree1d2199aecaa982962f646b8468053e13bf7cae9e
parent9f2d3e495d71507832894a00e5e1ee9563c41fa3
rtc: rv3029: revert error handling patch to rv3029_eeprom_write()

[ Upstream commit a6f26606ddd03c5eab8b2132f1bfaa768c06158f ]

My error handling "cleanup" was totally wrong.  Both the "err" and "ret"
variables are required.  The "err" variable holds the error codes for
rv3029_eeprom_enter/exit() and the "ret" variable holds the error codes
for if actual write fails.  In my patch if the write failed, the
function probably still returned success.

Reported-by: Tom Evans <tom.evans@motec.com.au>
Fixes: 97f5b0379c38 ("rtc: rv3029: Clean up error handling in rv3029_eeprom_write()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20190817065604.GB29951@mwanda
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-rv3029c2.c