Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Devendra Naga <devendra.aaru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Devendra Naga <devendra.aaru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] arm: mach-tegra: check wether we have debugfs enabled or not
Date: Wed, 17 Oct 2012 15:13:16 -0400	[thread overview]
Message-ID: <1350501196-5632-1-git-send-email-devendra.aaru@gmail.com> (raw)

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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

             reply	other threads:[~2012-10-17 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 19:13 Devendra Naga [this message]
     [not found] ` <1350501196-5632-1-git-send-email-devendra.aaru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-10-17 20:12   ` [PATCH] arm: mach-tegra: check wether we have debugfs enabled or not Russell King - ARM Linux
     [not found]     ` <20121017201244.GN21164-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-10-17 20:18       ` devendra.aaru
2012-10-17 21:22       ` Stephen Warren
     [not found]         ` <507F2185.3070408-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-10-17 22:14           ` Russell King - ARM Linux

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=1350501196-5632-1-git-send-email-devendra.aaru@gmail.com \
    --to=devendra.aaru-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox