Skip to content

Commit f9d5de4

Browse files
committed
thermal: tegra: 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. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Wei Ni <wni@nvidia.com> Cc: Yangtao Li <tiny.windzz@gmail.com> Cc: linux-pm@vger.kernel.org Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c008c67 commit f9d5de4

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

‎drivers/thermal/tegra/soctherm.c‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,23 +1485,13 @@ DEFINE_SHOW_ATTRIBUTE(regs);
14851485
static void soctherm_debug_init(struct platform_device *pdev)
14861486
{
14871487
struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
1488-
struct dentry *root, *file;
1488+
struct dentry *root;
14891489

14901490
root = debugfs_create_dir("soctherm", NULL);
1491-
if (!root) {
1492-
dev_err(&pdev->dev, "failed to create debugfs directory\n");
1493-
return;
1494-
}
14951491

14961492
tegra->debugfs_dir = root;
14971493

1498-
file = debugfs_create_file("reg_contents", 0644, root,
1499-
pdev, &regs_fops);
1500-
if (!file) {
1501-
dev_err(&pdev->dev, "failed to create debugfs file\n");
1502-
debugfs_remove_recursive(tegra->debugfs_dir);
1503-
tegra->debugfs_dir = NULL;
1504-
}
1494+
debugfs_create_file("reg_contents", 0644, root, pdev, &regs_fops);
15051495
}
15061496
#else
15071497
static inline void soctherm_debug_init(struct platform_device *pdev) {}

0 commit comments

Comments
 (0)