Commit 88409d0c authored by Andrew Donnellan's avatar Andrew Donnellan Committed by Michael Ellerman

powerpc/powernv: don't create OPAL msglog sysfs entry if memcons init fails

When initialising OPAL interfaces, there is a possibility that
opal_msglog_init() may fail to initialise the msglog/memory console.

Fix opal_msglog_sysfs_init() so it doesn't try to create sysfs entry for
the msglog if this occurs.
Suggested-by: default avatarJoel Stanley <joel@jms.id.au>
Fixes: 9b4fffa1 ("powerpc/powernv: new function to access OPAL msglog")
Signed-off-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 56c08e6d
...@@ -128,6 +128,11 @@ void __init opal_msglog_init(void) ...@@ -128,6 +128,11 @@ void __init opal_msglog_init(void)
void __init opal_msglog_sysfs_init(void) void __init opal_msglog_sysfs_init(void)
{ {
if (!opal_memcons) {
pr_warn("OPAL: message log initialisation failed, not creating sysfs entry\n");
return;
}
if (sysfs_create_bin_file(opal_kobj, &opal_msglog_attr) != 0) if (sysfs_create_bin_file(opal_kobj, &opal_msglog_attr) != 0)
pr_warn("OPAL: sysfs file creation failed\n"); pr_warn("OPAL: sysfs file creation failed\n");
} }
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