]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: gamecube: Always reset HW_SRNPROT after read
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Tue, 23 Aug 2022 13:07:02 +0000 (15:07 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 23 Aug 2022 20:27:58 +0000 (22:27 +0200)
commit61f7390fc9741ff13c15f162deac7b3694770829
tree3181eea199c128fab74776008b5dd3cc6a0126de
parent59b512d80aa301c54bd4b69a0e9993e81f6a448a
rtc: gamecube: Always reset HW_SRNPROT after read

This register would fail to be reset if reading the RTC bias failed for
whichever reason.  This commit reorganises the code around to
unconditionally write it back to its previous value, unmap it, and
return the result of regmap_read(), which makes it both simpler and more
correct in the error case.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220823130702.1046-1-linkmauve@linkmauve.fr
drivers/rtc/rtc-gamecube.c