]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firmware: tegra: bpmp: Propagate debugfs errors
authorJon Hunter <jonathanh@nvidia.com>
Fri, 29 May 2026 17:33:36 +0000 (18:33 +0100)
committerThierry Reding <treding@nvidia.com>
Sun, 31 May 2026 05:25:06 +0000 (07:25 +0200)
The Tegra BPMP debugfs code returns -ENOMEM for most cases where calls
to debugfs_create_dir() or debugfs_create_file() fail. These debugfs
functions return an ERR_PTR with the actual error code on failure.
Therefore, update the Tegra BPMP debugfs code to propagate the actual
error code on failure.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/bpmp-debugfs.c

index 4221fed70ad48c8d82b29279ecd47db8d968c973..29037e2b31585765340dfaf3fd6c781da7bee821 100644 (file)
@@ -468,7 +468,7 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
                        dentry = debugfs_create_file(name, mode, parent, bpmp,
                                                     &bpmp_debug_fops);
                        if (IS_ERR(dentry)) {
-                               err = -ENOMEM;
+                               err = PTR_ERR(dentry);
                                goto out;
                        }
                }
@@ -719,7 +719,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,
                if (t & DEBUGFS_S_ISDIR) {
                        dentry = debugfs_create_dir(name, parent);
                        if (IS_ERR(dentry))
-                               return -ENOMEM;
+                               return PTR_ERR(dentry);
                        err = bpmp_populate_dir(bpmp, seqbuf, dentry, depth+1);
                        if (err < 0)
                                return err;
@@ -732,7 +732,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,
                                                     parent, bpmp,
                                                     &debugfs_fops);
                        if (IS_ERR(dentry))
-                               return -ENOMEM;
+                               return PTR_ERR(dentry);
                }
        }
 
@@ -782,11 +782,11 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
 
        root = debugfs_create_dir("bpmp", NULL);
        if (IS_ERR(root))
-               return -ENOMEM;
+               return PTR_ERR(root);
 
        bpmp->debugfs_mirror = debugfs_create_dir("debug", root);
        if (IS_ERR(bpmp->debugfs_mirror)) {
-               err = -ENOMEM;
+               err = PTR_ERR(bpmp->debugfs_mirror);
                goto out;
        }