Skip to content

Commit

Permalink
USB: Fix debugfs_create_file's error checking method for usb/gadget/s…
Browse files Browse the repository at this point in the history
…3c2410_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>
  • Loading branch information
Zhaolei authored and Greg Kroah-Hartman committed Oct 22, 2008
1 parent 78c7341 commit d66937d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/usb/gadget/s3c2410_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,11 +1894,8 @@ 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)) {
dev_warn(dev, "debugfs file creation failed %ld\n",
PTR_ERR(udc->regs_info));
udc->regs_info = NULL;
}
if (!udc->regs_info)
dev_warn(dev, "debugfs file creation failed\n");
}

dev_dbg(dev, "probe ok\n");
Expand Down

0 comments on commit d66937d

Please sign in to comment.