diff options
author | Zhaolei <zhaolei@cn.fujitsu.com> | 2008-10-20 06:53:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 13:05:27 -0400 |
commit | d66937d71a67724870e03fa35af686e7efe85caf (patch) | |
tree | 3f718e0659b093e6064fa15afc4fcb4c3826b257 /drivers/usb/gadget | |
parent | 78c73414f4f6744e2ea5a07b263a9698aa6f2416 (diff) |
USB: Fix debugfs_create_file's error checking method for usb/gadget/s3c2410_udc
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/s3c2410_udc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c index 48f51b12d2e2..00ba06b44752 100644 --- a/drivers/usb/gadget/s3c2410_udc.c +++ b/drivers/usb/gadget/s3c2410_udc.c | |||
@@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev) | |||
1894 | udc->regs_info = debugfs_create_file("registers", S_IRUGO, | 1894 | udc->regs_info = debugfs_create_file("registers", S_IRUGO, |
1895 | s3c2410_udc_debugfs_root, | 1895 | s3c2410_udc_debugfs_root, |
1896 | udc, &s3c2410_udc_debugfs_fops); | 1896 | udc, &s3c2410_udc_debugfs_fops); |
1897 | if (IS_ERR(udc->regs_info)) { | 1897 | if (!udc->regs_info) |
1898 | dev_warn(dev, "debugfs file creation failed %ld\n", | 1898 | dev_warn(dev, "debugfs file creation failed\n"); |
1899 | PTR_ERR(udc->regs_info)); | ||
1900 | udc->regs_info = NULL; | ||
1901 | } | ||
1902 | } | 1899 | } |
1903 | 1900 | ||
1904 | dev_dbg(dev, "probe ok\n"); | 1901 | dev_dbg(dev, "probe ok\n"); |