Commit b962f5a4 authored by Stewart Smith's avatar Stewart Smith Committed by Michael Ellerman

powerpc/powernv: only register log if OPAL supports doing so

Correct use of REGISTER/UNREGISTER is to check if the token exists
before calling. If we don't we get a "OPAL: Called with bad token 101 !"
error, which is harmless but may be alarming to some.
Signed-off-by: default avatarStewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: default avatarVasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent df99e6eb
...@@ -665,6 +665,9 @@ static void __init opal_dump_region_init(void) ...@@ -665,6 +665,9 @@ static void __init opal_dump_region_init(void)
uint64_t size; uint64_t size;
int rc; int rc;
if (!opal_check_token(OPAL_REGISTER_DUMP_REGION))
return;
/* Register kernel log buffer */ /* Register kernel log buffer */
addr = log_buf_addr_get(); addr = log_buf_addr_get();
if (addr == NULL) if (addr == NULL)
...@@ -823,7 +826,8 @@ void opal_shutdown(void) ...@@ -823,7 +826,8 @@ void opal_shutdown(void)
} }
/* Unregister memory dump region */ /* Unregister memory dump region */
opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF); if (opal_check_token(OPAL_UNREGISTER_DUMP_REGION))
opal_unregister_dump_region(OPAL_DUMP_REGION_LOG_BUF);
} }
/* Export this so that test modules can use it */ /* Export this so that test modules can use it */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment