linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator:core.c: Fix error checking for debugfs_create_dir
@ 2023-05-15 17:29 Osama Muhammad
  2023-05-16 14:38 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Osama Muhammad @ 2023-05-15 17:29 UTC (permalink / raw)
  To: lgirdwood, broonie; +Cc: linux-kernel, Osama Muhammad, Ivan Orlov

This patch fixes the error checking in 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>
Suggested-by: Ivan Orlov <ivan.orlov0322@gmail.com>
---
 drivers/regulator/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dc741ac156c3..698ab7f5004b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5256,7 +5256,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
 	}
 
 	rdev->debugfs = debugfs_create_dir(rname, debugfs_root);
-	if (!rdev->debugfs) {
+	if (IS_ERR(rdev->debugfs)) {
 		rdev_warn(rdev, "Failed to create debugfs directory\n");
 		return;
 	}
@@ -6178,7 +6178,7 @@ static int __init regulator_init(void)
 	ret = class_register(&regulator_class);
 
 	debugfs_root = debugfs_create_dir("regulator", NULL);
-	if (!debugfs_root)
+	if (IS_ERR(debugfs_root))
 		pr_warn("regulator: Failed to create debugfs directory\n");
 
 #ifdef CONFIG_DEBUG_FS
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator:core.c: Fix error checking for debugfs_create_dir
  2023-05-15 17:29 [PATCH] regulator:core.c: Fix error checking for debugfs_create_dir Osama Muhammad
@ 2023-05-16 14:38 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-05-16 14:38 UTC (permalink / raw)
  To: lgirdwood, Osama Muhammad; +Cc: linux-kernel, Ivan Orlov

On Mon, 15 May 2023 22:29:38 +0500, Osama Muhammad wrote:
> This patch fixes the error checking in core.c in debugfs_create_dir.
> The correct way to check if an error occurred is 'IS_ERR' inline function.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/1] regulator:core.c: Fix error checking for debugfs_create_dir
      commit: 2bf1c45be3b8f3a3f898d0756c1282f09719debd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-16 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 17:29 [PATCH] regulator:core.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-16 14:38 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).