]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Fri, 13 Oct 2023 14:34:21 +0000 (16:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 09:30:14 +0000 (10:30 +0100)
commit37212eede637cdf9908faeb06b60193e13dc35e4
tree5faedd3bd8a68cc6ce437c6c12279a60d1694c4a
parent204beeb509d37669de34560e83bb8abffe7ee63a
rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call

[ Upstream commit 2be36c09b6b07306be33519e1aa70d2e2a2161bb ]

The current implementation passes PIN_IO_INTA_OUT (2) as a mask and
PIN_IO_INTAPM (GENMASK(1, 0)) as a value.
Swap the variables to assign mask and value the right way.

This error was first introduced with the alarm support. For better or
worse it worked as expected because 0x02 was applied as a mask to 0x03,
resulting 0x02 anyway. This will of course not work for any other value.

Fixes: e5aac267a10a ("rtc: pcf85363: add alarm support")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20231013-topic-pcf85363_regmap_update_bits-v1-1-c454f016f71f@gmail.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rtc/rtc-pcf85363.c