[PATCH 04/24] powerpc: check/return actual error on sysfs functions

Jeff Liu jeff.liu at oracle.com
Wed Jun 18 00:31:09 EST 2014


From: Jie Liu <jeff.liu at oracle.com>

Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: Paul Mackerras <paulus at samba.org>
Signed-off-by: Jie Liu <jeff.liu at oracle.com>
---
 arch/powerpc/platforms/powernv/opal-dump.c | 2 +-
 arch/powerpc/platforms/powernv/opal-elog.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 788a197..e718baf 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -424,7 +424,7 @@ void __init opal_platform_dump_init(void)
 	int rc;
 
 	dump_kset = kset_create_and_add("dump", NULL, opal_kobj);
-	if (!dump_kset) {
+	if (IS_ERR(dump_kset)) {
 		pr_warn("%s: Failed to create dump kset\n", __func__);
 		return;
 	}
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 10268c4..09c1f6f 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -296,9 +296,9 @@ int __init opal_elog_init(void)
 	int rc = 0;
 
 	elog_kset = kset_create_and_add("elog", NULL, opal_kobj);
-	if (!elog_kset) {
+	if (IS_ERR(elog_kset)) {
 		pr_warn("%s: failed to create elog kset\n", __func__);
-		return -1;
+		return PTR_ERR(elog_kset);
 	}
 
 	rc = opal_notifier_register(&elog_nb);
-- 
1.8.3.2


More information about the Linuxppc-dev mailing list