Commit 8bdaa438 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Mark Brown

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: default avatarGreg 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.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 66c3b96a
...@@ -67,8 +67,6 @@ static int power_state_active_get(void) ...@@ -67,8 +67,6 @@ static int power_state_active_get(void)
static struct ux500_regulator_debug { static struct ux500_regulator_debug {
struct dentry *dir; struct dentry *dir;
struct dentry *status_file;
struct dentry *power_state_cnt_file;
struct dbx500_regulator_info *regulator_array; struct dbx500_regulator_info *regulator_array;
int num_regulators; int num_regulators;
u8 *state_before_suspend; u8 *state_before_suspend;
...@@ -117,22 +115,14 @@ ux500_regulator_debug_init(struct platform_device *pdev, ...@@ -117,22 +115,14 @@ ux500_regulator_debug_init(struct platform_device *pdev,
{ {
/* create directory */ /* create directory */
rdebug.dir = debugfs_create_dir("ux500-regulator", NULL); rdebug.dir = debugfs_create_dir("ux500-regulator", NULL);
if (!rdebug.dir)
goto exit_no_debugfs;
/* create "status" file */ /* create "status" file */
rdebug.status_file = debugfs_create_file("status", debugfs_create_file("status", S_IRUGO, rdebug.dir, &pdev->dev,
S_IRUGO, rdebug.dir, &pdev->dev,
&ux500_regulator_status_fops); &ux500_regulator_status_fops);
if (!rdebug.status_file)
goto exit_destroy_dir;
/* create "power-state-count" file */ /* create "power-state-count" file */
rdebug.power_state_cnt_file = debugfs_create_file("power-state-count", debugfs_create_file("power-state-count", S_IRUGO, rdebug.dir,
S_IRUGO, rdebug.dir, &pdev->dev, &pdev->dev, &ux500_regulator_power_state_cnt_fops);
&ux500_regulator_power_state_cnt_fops);
if (!rdebug.power_state_cnt_file)
goto exit_destroy_status;
rdebug.regulator_array = regulator_info; rdebug.regulator_array = regulator_info;
rdebug.num_regulators = num_regulators; rdebug.num_regulators = num_regulators;
...@@ -150,11 +140,7 @@ ux500_regulator_debug_init(struct platform_device *pdev, ...@@ -150,11 +140,7 @@ ux500_regulator_debug_init(struct platform_device *pdev,
exit_free: exit_free:
kfree(rdebug.state_before_suspend); kfree(rdebug.state_before_suspend);
exit_destroy_power_state: exit_destroy_power_state:
debugfs_remove(rdebug.power_state_cnt_file); debugfs_remove_recursive(rdebug.dir);
exit_destroy_status:
debugfs_remove(rdebug.status_file);
exit_destroy_dir:
debugfs_remove(rdebug.dir);
exit_no_debugfs: exit_no_debugfs:
dev_err(&pdev->dev, "failed to create debugfs entries.\n"); dev_err(&pdev->dev, "failed to create debugfs entries.\n");
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment