mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-07-09 14:38:21 +00:00
lib: sbi: Fix return of sbi_console_init
console is not a required peripheral. So it should return success when the console does not exist. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
d4c46e0ff1
commit
8b99a7f7d8
1 changed files with 7 additions and 1 deletions
|
@ -481,5 +481,11 @@ void sbi_console_set_device(const struct sbi_console_device *dev)
|
||||||
|
|
||||||
int sbi_console_init(struct sbi_scratch *scratch)
|
int sbi_console_init(struct sbi_scratch *scratch)
|
||||||
{
|
{
|
||||||
return sbi_platform_console_init(sbi_platform_ptr(scratch));
|
int rc = sbi_platform_console_init(sbi_platform_ptr(scratch));
|
||||||
|
|
||||||
|
/* console is not a necessary device */
|
||||||
|
if (rc == SBI_ENODEV)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue