* [PATCH] rtc: isl12022: Add missing check for device_property_read_u32_array
@ 2026-01-28 4:34 Chen Ni
2026-01-28 10:16 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2026-01-28 4:34 UTC (permalink / raw)
To: alexandre.belloni; +Cc: linux-rtc, linux-kernel, Chen Ni
Add check for the return value of device_property_read_u32_array() and
log a warning message if it fails in order to catch the error.
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
drivers/rtc/rtc-isl12022.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index 5fc52dc64213..6f66ec4a9948 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -517,8 +517,10 @@ static void isl12022_set_trip_levels(struct device *dev)
int ret, i, j, x[2];
u8 val, mask;
- device_property_read_u32_array(dev, "isil,battery-trip-levels-microvolt",
- levels, 2);
+ ret = device_property_read_u32_array(dev, "isil,battery-trip-levels-microvolt",
+ levels, 2);
+ if (ret)
+ dev_warn(dev, "failed to read battery-trip-levels-microvolt: %d\n", ret);
for (i = 0; i < 2; i++) {
for (j = 0; j < ARRAY_SIZE(trip_levels[i]) - 1; j++) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-28 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 4:34 [PATCH] rtc: isl12022: Add missing check for device_property_read_u32_array Chen Ni
2026-01-28 10:16 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox