Skip to content

Commit

Permalink
thermal: intel: no need to check return value of debugfs_create funct…
Browse files Browse the repository at this point in the history
…ions

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: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jun 18, 2019
1 parent 108ae07 commit 72c9f26
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions drivers/thermal/intel/x86_pkg_temp_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,14 @@ static struct dentry *debugfs;
static unsigned int pkg_interrupt_cnt;
static unsigned int pkg_work_cnt;

static int pkg_temp_debugfs_init(void)
static void pkg_temp_debugfs_init(void)
{
struct dentry *d;

debugfs = debugfs_create_dir("pkg_temp_thermal", NULL);
if (!debugfs)
return -ENOENT;

d = debugfs_create_u32("pkg_thres_interrupt", S_IRUGO, debugfs,
&pkg_interrupt_cnt);
if (!d)
goto err_out;

d = debugfs_create_u32("pkg_thres_work", S_IRUGO, debugfs,
&pkg_work_cnt);
if (!d)
goto err_out;

return 0;

err_out:
debugfs_remove_recursive(debugfs);
return -ENOENT;
debugfs_create_u32("pkg_thres_interrupt", S_IRUGO, debugfs,
&pkg_interrupt_cnt);
debugfs_create_u32("pkg_thres_work", S_IRUGO, debugfs,
&pkg_work_cnt);
}

/*
Expand Down

0 comments on commit 72c9f26

Please sign in to comment.