Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: imx21-hcd: 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 <felipe.balbi@linux.intel.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+10 -34
+10 -34
drivers/usb/host/imx21-dbg.c
··· 417 417 418 418 static void create_debug_files(struct imx21 *imx21) 419 419 { 420 - imx21->debug_root = debugfs_create_dir(dev_name(imx21->dev), NULL); 421 - if (!imx21->debug_root) 422 - goto failed_create_rootdir; 420 + struct dentry *root; 423 421 424 - if (!debugfs_create_file("status", S_IRUGO, 425 - imx21->debug_root, imx21, &debug_status_fops)) 426 - goto failed_create; 422 + root = debugfs_create_dir(dev_name(imx21->dev), NULL); 423 + imx21->debug_root = root; 427 424 428 - if (!debugfs_create_file("dmem", S_IRUGO, 429 - imx21->debug_root, imx21, &debug_dmem_fops)) 430 - goto failed_create; 431 - 432 - if (!debugfs_create_file("etd", S_IRUGO, 433 - imx21->debug_root, imx21, &debug_etd_fops)) 434 - goto failed_create; 435 - 436 - if (!debugfs_create_file("statistics", S_IRUGO, 437 - imx21->debug_root, imx21, &debug_statistics_fops)) 438 - goto failed_create; 439 - 440 - if (!debugfs_create_file("isoc", S_IRUGO, 441 - imx21->debug_root, imx21, &debug_isoc_fops)) 442 - goto failed_create; 443 - 444 - return; 445 - 446 - failed_create: 447 - debugfs_remove_recursive(imx21->debug_root); 448 - 449 - failed_create_rootdir: 450 - imx21->debug_root = NULL; 425 + debugfs_create_file("status", S_IRUGO, root, imx21, &debug_status_fops); 426 + debugfs_create_file("dmem", S_IRUGO, root, imx21, &debug_dmem_fops); 427 + debugfs_create_file("etd", S_IRUGO, root, imx21, &debug_etd_fops); 428 + debugfs_create_file("statistics", S_IRUGO, root, imx21, 429 + &debug_statistics_fops); 430 + debugfs_create_file("isoc", S_IRUGO, root, imx21, &debug_isoc_fops); 451 431 } 452 - 453 432 454 433 static void remove_debug_files(struct imx21 *imx21) 455 434 { 456 - if (imx21->debug_root) { 457 - debugfs_remove_recursive(imx21->debug_root); 458 - imx21->debug_root = NULL; 459 - } 435 + debugfs_remove_recursive(imx21->debug_root); 460 436 } 461 437 462 438 #endif