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

regmap: 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.

The debugfs core will warn if a file or directory can not be created, so
there's no need to duplicate the warning, nor really do anything else.

Cc: Mark Brown <broonie@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20190731132923.GA13829@kroah.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Greg Kroah-Hartman and committed by
Mark Brown
9d52a35e 5f9e832c

-12
-12
drivers/base/regmap/regmap-debugfs.c
··· 588 588 } 589 589 590 590 map->debugfs = debugfs_create_dir(name, regmap_debugfs_root); 591 - if (!map->debugfs) { 592 - dev_warn(map->dev, 593 - "Failed to create %s debugfs directory\n", name); 594 - 595 - kfree(map->debugfs_name); 596 - map->debugfs_name = NULL; 597 - return; 598 - } 599 591 600 592 debugfs_create_file("name", 0400, map->debugfs, 601 593 map, &regmap_name_fops); ··· 664 672 struct regmap_debugfs_node *node, *tmp; 665 673 666 674 regmap_debugfs_root = debugfs_create_dir("regmap", NULL); 667 - if (!regmap_debugfs_root) { 668 - pr_warn("regmap: Failed to create debugfs root\n"); 669 - return; 670 - } 671 675 672 676 mutex_lock(&regmap_debugfs_early_lock); 673 677 list_for_each_entry_safe(node, tmp, &regmap_debugfs_early_list, link) {