Re: [PATCH v2] rtc: spacemit: handle regmap_test_bits() error return
Alexandre Belloni <[email protected]>
| Newsgroups | dev.linux.lists.spacemit,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kernel.vger.linux-rtc |
|---|---|
| Message-ID | <178715693830.130787.3002190547423884283.b4-ty@b4> |
On Fri, 24 Jul 2026 19:28:03 +0530, [email protected] 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