powerpc/powernv: Check OPAL elog calls exist before using
authorMichael Neuling <mikey@neuling.org>
Tue, 19 Aug 2014 04:48:01 +0000 (14:48 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 25 Sep 2014 13:14:36 +0000 (23:14 +1000)
Check that the OPAL_ELOG_READ token exists before initalising the elog
infrastructure.

This avoids littering the OPAL console with:
  "OPAL: Called with bad token 74"

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal-elog.c

index bbdb3ffaab98f165a63b000961a26c3db41cc921..518fe95dbf24ec6bde07bf1f7c3923db0680b361 100644 (file)
@@ -295,6 +295,10 @@ int __init opal_elog_init(void)
 {
        int rc = 0;
 
+       /* ELOG not supported by firmware */
+       if (!opal_check_token(OPAL_ELOG_READ))
+               return -1;
+
        elog_kset = kset_create_and_add("elog", NULL, opal_kobj);
        if (!elog_kset) {
                pr_warn("%s: failed to create elog kset\n", __func__);