forked from Mirrors/opensbi
lib: sbi: Only register available extensions
When an extension implements a probe function it means there's a chance that the extension is not available. Use this function in the register_extensions callback to determine if the extension should be registered at all. Where the probe implementation is simple, just open code the check. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -59,6 +59,9 @@ struct sbi_ecall_extension ecall_cppc;
|
||||
|
||||
static int sbi_ecall_cppc_register_extensions(void)
|
||||
{
|
||||
if (!sbi_cppc_get_device())
|
||||
return 0;
|
||||
|
||||
return sbi_ecall_register_extension(&ecall_cppc);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user