lkml.org 
[lkml]   [2008]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix debugfs_create_file's error checking method for usb/gadget/
Hi,

debugfs_create_file() returns NULL if an error occurs, returns -ENODEV
when debugfs is not enabled in the kernel.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
drivers/usb/gadget/s3c2410_udc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 29d13eb..4ba50ef 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1894,7 +1894,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
udc->regs_info = debugfs_create_file("registers", S_IRUGO,
s3c2410_udc_debugfs_root,
udc, &s3c2410_udc_debugfs_fops);
- if (IS_ERR(udc->regs_info)) {
+ if (IS_ERR(udc->regs_info) || !udc->regs_info) {
dev_warn(dev, "debugfs file creation failed %ld\n",
PTR_ERR(udc->regs_info));
udc->regs_info = NULL;
--
1.5.5.3



\
 
 \ /
  Last update: 2008-10-17 14:59    [from the cache]
©2003-2011 Jasper Spaans