aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang W <wxjstz@126.com>2024-06-11 19:19:33 +0800
committerAnup Patel <anup@brainfault.org>2024-06-13 18:40:38 +0530
commitb5c984bd089510cc6c7ad7a5646ead1cf8ea676a (patch)
tree69173226597d69db1fd8a08d75be60a01696a04d
parent86bbe6c52faf48a5bcca2e3073d47d501408bee0 (diff)
downloadopensbi-b5c984bd089510cc6c7ad7a5646ead1cf8ea676a.zip
opensbi-b5c984bd089510cc6c7ad7a5646ead1cf8ea676a.tar.gz
opensbi-b5c984bd089510cc6c7ad7a5646ead1cf8ea676a.tar.bz2
lib: utils/reset: Skip initialize reset when dt is not enabled
When the dt node has a status property and the value is not ok or okay, skip initializing reset. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r--lib/utils/reset/fdt_reset.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c
index 4334586..327fb99 100644
--- a/lib/utils/reset/fdt_reset.c
+++ b/lib/utils/reset/fdt_reset.c
@@ -26,6 +26,9 @@ int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv)
if (noff < 0)
return SBI_ENODEV;
+ if (!fdt_node_is_enabled(fdt, noff))
+ return SBI_ENODEV;
+
if (drv->init) {
rc = drv->init(fdt, noff, match);
if (rc && rc != SBI_ENODEV) {