[PATCH] arm: mach-tegra: check wether we have debugfs enabled or not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



if debugfs is not enabled in kernel it returns -ENODEV, check it
with IS_ERR_OR_NULL along with the null return if it fails to
create a file in debugfs.

Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---
 arch/arm/mach-tegra/powergate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index de0662d..1809b91d 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -269,7 +269,7 @@ int __init tegra_powergate_debugfs_init(void)
 	if (powergate_name) {
 		d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
 			&powergate_fops);
-		if (!d)
+		if (IS_ERR_OR_NULL(d))
 			return -ENOMEM;
 	}
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux