Skip to content

Commit 9d54be8

Browse files
panantoni01gregkh
authored andcommitted
rtc: abx80x: fix the RTC_VL_CLR clearing all status flags
[ Upstream commit 419719c ] The RTC_VL_CLR ioctl intends to clear only the battery low flag (BLF), however the current implementation writes 0 to the status register, clearing all status bits. Fix this by writing back the masked status value so that only BLF is cleared, preserving other status flags. Fixes: ffe1c5a ("rtc: abx80x: Implement RTC_VL_READ,CLR ioctls") Signed-off-by: Antoni Pokusinski <apokusinski01@gmail.com> Link: https://patch.msgid.link/20260415160610.127155-2-apokusinski01@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 678c6f1 commit 9d54be8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/rtc/rtc-abx80x.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ static int abx80x_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
533533

534534
status &= ~ABX8XX_STATUS_BLF;
535535

536-
tmp = i2c_smbus_write_byte_data(client, ABX8XX_REG_STATUS, 0);
536+
tmp = i2c_smbus_write_byte_data(client, ABX8XX_REG_STATUS,
537+
status);
537538
if (tmp < 0)
538539
return tmp;
539540

0 commit comments

Comments
 (0)