[PATCH v2] rtc: spacemit: handle regmap_test_bits() error return

Alexandre Belloni alexandre.belloni at bootlin.com
Wed Aug 19 09:29:23 PDT 2026


On Fri, 24 Jul 2026 19:28:03 +0530, kr494167 at gmail.com wrote:
> p1_rtc_read_time() called if (!regmap_test_bits(regmap, RTC_CTRL, RTC_EN))
> to check if the RTC was enabled.
> 
> regmap_test_bits() returns 1 if the bit is set, 0 if not set, and a
> negative error code (e.g. -EIO) if reading the control register fails.
> Using !regmap_test_bits(...) evaluates a negative error code as boolean
> false, causing I2C/regmap read failures to be ignored and incorrectly
> proceeding to read time registers from a failing device.
> 
> [...]

Applied, thanks!

[1/1] rtc: spacemit: handle regmap_test_bits() error return
      https://git.kernel.org/abelloni/c/092755367e1a

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-riscv mailing list