Skip to content

Commit e15bea0

Browse files
committed
USB: gadget: udc: s3c2410_udc: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Felipe Balbi <[email protected]> Cc: Li Yang <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Robert Jarzmik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 743d1ef commit e15bea0

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

drivers/usb/gadget/udc/s3c2410_udc.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,13 +1871,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
18711871
if (retval)
18721872
goto err_add_udc;
18731873

1874-
if (s3c2410_udc_debugfs_root) {
1875-
udc->regs_info = debugfs_create_file("registers", S_IRUGO,
1876-
s3c2410_udc_debugfs_root,
1877-
udc, &s3c2410_udc_debugfs_fops);
1878-
if (!udc->regs_info)
1879-
dev_warn(dev, "debugfs file creation failed\n");
1880-
}
1874+
udc->regs_info = debugfs_create_file("registers", S_IRUGO,
1875+
s3c2410_udc_debugfs_root, udc,
1876+
&s3c2410_udc_debugfs_fops);
18811877

18821878
dev_dbg(dev, "probe ok\n");
18831879

@@ -1994,11 +1990,6 @@ static int __init udc_init(void)
19941990
dprintk(DEBUG_NORMAL, "%s\n", gadget_name);
19951991

19961992
s3c2410_udc_debugfs_root = debugfs_create_dir(gadget_name, NULL);
1997-
if (IS_ERR(s3c2410_udc_debugfs_root)) {
1998-
pr_err("%s: debugfs dir creation failed %ld\n",
1999-
gadget_name, PTR_ERR(s3c2410_udc_debugfs_root));
2000-
s3c2410_udc_debugfs_root = NULL;
2001-
}
20021993

20031994
retval = platform_driver_register(&udc_driver_24x0);
20041995
if (retval)
@@ -2014,7 +2005,7 @@ static int __init udc_init(void)
20142005
static void __exit udc_exit(void)
20152006
{
20162007
platform_driver_unregister(&udc_driver_24x0);
2017-
debugfs_remove(s3c2410_udc_debugfs_root);
2008+
debugfs_remove_recursive(s3c2410_udc_debugfs_root);
20182009
}
20192010

20202011
module_init(udc_init);

0 commit comments

Comments
 (0)