From: Mark Brown Date: Mon, 20 Feb 2012 21:01:04 +0000 (+0000) Subject: regulator: Clean up debugfs error handling a bit X-Git-Tag: firefly_0821_release~3680^2~3139^2~25 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f4d562c6e616bb686f43d38752b2e5b83359e1fc;p=firefly-linux-kernel-4.4.55.git regulator: Clean up debugfs error handling a bit Use IS_ERR_OR_NULL() rather than open coding it and ignore errors from failure to create the supply map. Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 6c845200a530..81ea66dcca9c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2712,7 +2712,7 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) { #ifdef CONFIG_DEBUG_FS rdev->debugfs = debugfs_create_dir(rdev_get_name(rdev), debugfs_root); - if (IS_ERR(rdev->debugfs) || !rdev->debugfs) { + if (IS_ERR_OR_NULL(rdev->debugfs)) { rdev_warn(rdev, "Failed to create debugfs directory\n"); rdev->debugfs = NULL; return; @@ -3127,14 +3127,13 @@ static int __init regulator_init(void) #ifdef CONFIG_DEBUG_FS debugfs_root = debugfs_create_dir("regulator", NULL); - if (IS_ERR(debugfs_root) || !debugfs_root) { + if (IS_ERR_OR_NULL(debugfs_root)) { pr_warn("regulator: Failed to create debugfs directory\n"); debugfs_root = NULL; } - if (IS_ERR(debugfs_create_file("supply_map", 0444, debugfs_root, - NULL, &supply_map_fops))) - pr_warn("regulator: Failed to create supplies debugfs\n"); + debugfs_create_file("supply_map", 0444, debugfs_root, NULL, + &supply_map_fops); #endif regulator_dummy_init();