mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
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 <namcao@linutronix.de> Tested-by: Minda Chen <minda.chen@starfivetech.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
80ae0464c1
commit
3edf0447df
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue