[PATCH] powerpc/powernv: use appropiate error code

mirimmad at outlook.com mirimmad at outlook.com
Sat Sep 2 03:19:12 AEST 2023


From: Immad Mir <mirimmad17 at gmail.com>

-1 is not a valid error code. This patch replaces it with -EPERM.

Signed-off-by: Immad Mir <mirimmad17 at gmail.com>
---
 arch/powerpc/platforms/powernv/opal-xscom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c
index 262cd6fac..ce4b089dd 100644
--- a/arch/powerpc/platforms/powernv/opal-xscom.c
+++ b/arch/powerpc/platforms/powernv/opal-xscom.c
@@ -171,7 +171,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
 	if (IS_ERR(dir)) {
 		kfree(ent->path.data);
 		kfree(ent);
-		return -1;
+		return -EPERM;
 	}

 	debugfs_create_blob("devspec", 0400, dir, &ent->path);
@@ -191,7 +191,7 @@ static int scom_debug_init(void)

 	root = debugfs_create_dir("scom", arch_debugfs_dir);
 	if (IS_ERR(root))
-		return -1;
+		return -EPERM;

 	rc = 0;
 	for_each_node_with_property(dn, "scom-controller") {
--
2.40.0



More information about the Linuxppc-dev mailing list