Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 401606fd authored by Jean Pihet's avatar Jean Pihet Committed by Kevin Hilman
Browse files

ARM: OMAP2+: PM debug: fix the use of debugfs_create_* API



Check the return code pointer value from debugfs_create_dir for error
or NULL.
Also added an additional check to prevent the creation of a 'suspend'
entry at the debugfs root in case a power domain directory cannot be
created.

Signed-off-by: default avatarJean Pihet <j-pihet@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent 92206fd2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
		return 0;

	d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);

	if (!(IS_ERR_OR_NULL(d)))
		(void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
			(void *)pwrdm, &pwrdm_suspend_fops);

@@ -264,7 +264,7 @@ static int __init pm_dbg_init(void)
		return 0;

	d = debugfs_create_dir("pm_debug", NULL);
	if (IS_ERR(d))
	if (IS_ERR_OR_NULL(d))
		return PTR_ERR(d);

	(void) debugfs_create_file("count", S_IRUGO,