summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorNam Cao <[email protected]>2024-02-22 09:16:18 +0100
committerAnup Patel <[email protected]>2024-02-22 18:16:48 +0530
commit3edf0447df9cb5e63f5f584ab97357f3c5aa0fbf (patch)
tree2965159750a4bafa3c278e3407e9e5738163d89f /platform
parent80ae0464c157cc7a769c2bb1140424409ee4fc1a (diff)
platform: starfive: return error if needed devices are not present
Jh7110's reset driver needs power management device and clock controller device to work. Currently, the driver proceed anyway without these devices, and invalid addresses (jh7110_inst.pmu_reg_base and jh7110_inst.clk_reg_base) are used during reboot, which causes unpredictable broken behaviors. If these devices are not present, return -SBI_ENODEV. Signed-off-by: Nam Cao <[email protected]> Tested-by: Minda Chen <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'platform')
-rw-r--r--platform/generic/starfive/jh7110.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/generic/starfive/jh7110.c b/platform/generic/starfive/jh7110.c
index 16b94eae..1ac0854c 100644
--- a/platform/generic/starfive/jh7110.c
+++ b/platform/generic/starfive/jh7110.c
@@ -239,6 +239,8 @@ static int starfive_jh7110_inst_init(void *fdt)
if (rc)
goto err;
jh7110_inst.pmu_reg_base = addr;
+ } else {
+ return -SBI_ENODEV;
}
noff = fdt_node_offset_by_compatible(fdt, -1, "starfive,jh7110-syscrg");
@@ -247,6 +249,8 @@ static int starfive_jh7110_inst_init(void *fdt)
if (rc)
goto err;
jh7110_inst.clk_reg_base = addr;
+ } else {
+ return -SBI_ENODEV;
}
if (pmic_inst.adapter) {