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>
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;
}