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

regulator: dbx500: 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.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20200818133701.462958-1-gregkh@linuxfoundation.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Greg Kroah-Hartman and committed by
Mark Brown
8bdaa438 66c3b96a

+5 -19
+5 -19
drivers/regulator/dbx500-prcmu.c
··· 67 67 68 68 static struct ux500_regulator_debug { 69 69 struct dentry *dir; 70 - struct dentry *status_file; 71 - struct dentry *power_state_cnt_file; 72 70 struct dbx500_regulator_info *regulator_array; 73 71 int num_regulators; 74 72 u8 *state_before_suspend; ··· 115 117 { 116 118 /* create directory */ 117 119 rdebug.dir = debugfs_create_dir("ux500-regulator", NULL); 118 - if (!rdebug.dir) 119 - goto exit_no_debugfs; 120 120 121 121 /* create "status" file */ 122 - rdebug.status_file = debugfs_create_file("status", 123 - S_IRUGO, rdebug.dir, &pdev->dev, 124 - &ux500_regulator_status_fops); 125 - if (!rdebug.status_file) 126 - goto exit_destroy_dir; 122 + debugfs_create_file("status", S_IRUGO, rdebug.dir, &pdev->dev, 123 + &ux500_regulator_status_fops); 127 124 128 125 /* create "power-state-count" file */ 129 - rdebug.power_state_cnt_file = debugfs_create_file("power-state-count", 130 - S_IRUGO, rdebug.dir, &pdev->dev, 131 - &ux500_regulator_power_state_cnt_fops); 132 - if (!rdebug.power_state_cnt_file) 133 - goto exit_destroy_status; 126 + debugfs_create_file("power-state-count", S_IRUGO, rdebug.dir, 127 + &pdev->dev, &ux500_regulator_power_state_cnt_fops); 134 128 135 129 rdebug.regulator_array = regulator_info; 136 130 rdebug.num_regulators = num_regulators; ··· 140 150 exit_free: 141 151 kfree(rdebug.state_before_suspend); 142 152 exit_destroy_power_state: 143 - debugfs_remove(rdebug.power_state_cnt_file); 144 - exit_destroy_status: 145 - debugfs_remove(rdebug.status_file); 146 - exit_destroy_dir: 147 - debugfs_remove(rdebug.dir); 153 + debugfs_remove_recursive(rdebug.dir); 148 154 exit_no_debugfs: 149 155 dev_err(&pdev->dev, "failed to create debugfs entries.\n"); 150 156 return -ENOMEM;