forked from Mirrors/opensbi
lib: sbi: convert reset to list
To support different handlers for different types of resets, we are adding a sbi_list of restart handlers. Instead of sbi_system_reset_set_device we use sbi_system_reset_add_device to reflect the actual meaning. Signed-off-by: Nikita Shubin <n.shubin@yadro.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:

committed by
Anup Patel

parent
754d51192b
commit
516161c46f
@@ -115,7 +115,7 @@ static int gpio_reset_init(void *fdt, int nodeoff,
|
||||
if (len > 0)
|
||||
reset->inactive_delay = fdt32_to_cpu(*val);
|
||||
|
||||
sbi_system_reset_set_device(&gpio_reset);
|
||||
sbi_system_reset_add_device(&gpio_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ static int sunxi_wdt_reset_init(void *fdt, int nodeoff,
|
||||
|
||||
sunxi_wdt_base = (volatile void *)(unsigned long)reg_addr;
|
||||
|
||||
sbi_system_reset_set_device(&sunxi_wdt_reset);
|
||||
sbi_system_reset_add_device(&sunxi_wdt_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -126,7 +126,7 @@ static int thead_reset_init(void *fdt, int nodeoff,
|
||||
}
|
||||
}
|
||||
|
||||
sbi_system_reset_set_device(&thead_reset);
|
||||
sbi_system_reset_add_device(&thead_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -176,7 +176,7 @@ static struct sbi_system_reset_device htif_reset = {
|
||||
|
||||
int htif_system_reset_init(void)
|
||||
{
|
||||
sbi_system_reset_set_device(&htif_reset);
|
||||
sbi_system_reset_add_device(&htif_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ static struct sbi_system_reset_device sifive_test_reset = {
|
||||
int sifive_test_init(unsigned long base)
|
||||
{
|
||||
sifive_test_base = (void *)base;
|
||||
sbi_system_reset_set_device(&sifive_test_reset);
|
||||
sbi_system_reset_add_device(&sifive_test_reset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user