]> 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)
commit131cccb4c0f790e932a3c8fd95ebb51d7937c087
tree3181eea199c128fab74776008b5dd3cc6a0126de
parentcadc98d2f991a7c04d02aa21cacb3cdf247d6bb3
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