public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc/pmc.c: Fix error checking for debugfs_create_dir
@ 2023-05-17 16:13 Osama Muhammad
  0 siblings, 0 replies; only message in thread
From: Osama Muhammad @ 2023-05-17 16:13 UTC (permalink / raw)
  To: thierry.reding, jonathanh, petlozup, stefank, sushilkumars,
	christophe.jaillet, viresh.kumar, dmitry.osipenko
  Cc: linux-tegra, linux-kernel, Osama Muhammad

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

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 5d17799524c9..ac468e4a225c 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1194,7 +1194,7 @@ static int tegra_powergate_debugfs_init(void)
 {
 	pmc->debugfs = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
 					   &powergate_fops);
-	if (!pmc->debugfs)
+	if (IS_ERR(pmc->debugfs))
 		return -ENOMEM;
 
 	return 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-17 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 16:13 [PATCH] soc/pmc.c: Fix error checking for debugfs_create_dir Osama Muhammad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox