All of lore.kernel.org
 help / color / mirror / Atom feed
From: Osama Muhammad <osmtendev@gmail.com>
To: broonie@kernel.org, fancer.lancer@gmail.com
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Osama Muhammad <osmtendev@gmail.com>
Subject: [PATCH] spi-dw-core.c: Fix error checking for debugfs_create_dir
Date: Wed, 17 May 2023 22:31:02 +0500	[thread overview]
Message-ID: <20230517173102.14096-1-osmtendev@gmail.com> (raw)

This patch fixes the error checking in spi-dw-core.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/spi/spi-dw-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
index ae3108c70f50..c9cdf6bbcd0e 100644
--- a/drivers/spi/spi-dw-core.c
+++ b/drivers/spi/spi-dw-core.c
@@ -63,7 +63,7 @@ static int dw_spi_debugfs_init(struct dw_spi *dws)
 
 	snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
 	dws->debugfs = debugfs_create_dir(name, NULL);
-	if (!dws->debugfs)
+	if (IS_ERR(dws->debugfs))
 		return -ENOMEM;
 
 	dws->regset.regs = dw_spi_dbgfs_regs;
-- 
2.34.1


             reply	other threads:[~2023-05-17 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 17:31 Osama Muhammad [this message]
2023-05-17 21:21 ` [PATCH] spi-dw-core.c: Fix error checking for debugfs_create_dir Serge Semin

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=20230517173102.14096-1-osmtendev@gmail.com \
    --to=osmtendev@gmail.com \
    --cc=broonie@kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.