From: Osama Muhammad <osmtendev@gmail.com>
To: sre@kernel.org, jinpu.wang@ionos.com
Cc: linux-kernel@vger.kernel.org, Osama Muhammad <osmtendev@gmail.com>
Subject: [PATCH] omap_ssi_port.c: Fix error checking for debugfs_create_dir
Date: Tue, 23 May 2023 22:24:34 +0500 [thread overview]
Message-ID: <20230523172434.13477-1-osmtendev@gmail.com> (raw)
This patch fixes the error checking in omap_ssi_port.c in
debugfs_create_dir. The correct way to check if an error occurred
is 'IS_ERR' inline function.
Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
drivers/hsi/controllers/omap_ssi_port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
index b9495b720f1b..7ad41599baa5 100644
--- a/drivers/hsi/controllers/omap_ssi_port.c
+++ b/drivers/hsi/controllers/omap_ssi_port.c
@@ -157,12 +157,12 @@ static int ssi_debug_add_port(struct omap_ssi_port *omap_port,
struct hsi_port *port = to_hsi_port(omap_port->dev);
dir = debugfs_create_dir(dev_name(omap_port->dev), dir);
- if (!dir)
+ if (IS_ERR(dir))
return -ENOMEM;
omap_port->dir = dir;
debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops);
dir = debugfs_create_dir("sst", dir);
- if (!dir)
+ if (IS_ERR(dir))
return -ENOMEM;
debugfs_create_file_unsafe("divisor", 0644, dir, port,
&ssi_sst_div_fops);
--
2.34.1
next reply other threads:[~2023-05-23 17:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-23 17:24 Osama Muhammad [this message]
2023-05-25 12:56 ` [PATCH] omap_ssi_port.c: Fix error checking for debugfs_create_dir Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230523172434.13477-1-osmtendev@gmail.com \
--to=osmtendev@gmail.com \
--cc=jinpu.wang@ionos.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox