提交 d66937d7 编写于 作者: Z Zhaolei 提交者: Greg Kroah-Hartman

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: NZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 78c73414
...@@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev) ...@@ -1894,11 +1894,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
udc->regs_info = debugfs_create_file("registers", S_IRUGO, udc->regs_info = debugfs_create_file("registers", S_IRUGO,
s3c2410_udc_debugfs_root, s3c2410_udc_debugfs_root,
udc, &s3c2410_udc_debugfs_fops); udc, &s3c2410_udc_debugfs_fops);
if (IS_ERR(udc->regs_info)) { if (!udc->regs_info)
dev_warn(dev, "debugfs file creation failed %ld\n", dev_warn(dev, "debugfs file creation failed\n");
PTR_ERR(udc->regs_info));
udc->regs_info = NULL;
}
} }
dev_dbg(dev, "probe ok\n"); dev_dbg(dev, "probe ok\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册