Commit f9d5de40 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c008c675
Loading
Loading
Loading
Loading
+2 −12
Original line number Original line Diff line number Diff line
@@ -1485,23 +1485,13 @@ DEFINE_SHOW_ATTRIBUTE(regs);
static void soctherm_debug_init(struct platform_device *pdev)
static void soctherm_debug_init(struct platform_device *pdev)
{
{
	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
	struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
	struct dentry *root, *file;
	struct dentry *root;


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


	tegra->debugfs_dir = root;
	tegra->debugfs_dir = root;


	file = debugfs_create_file("reg_contents", 0644, root,
	debugfs_create_file("reg_contents", 0644, root, pdev, &regs_fops);
				   pdev, &regs_fops);
	if (!file) {
		dev_err(&pdev->dev, "failed to create debugfs file\n");
		debugfs_remove_recursive(tegra->debugfs_dir);
		tegra->debugfs_dir = NULL;
	}
}
}
#else
#else
static inline void soctherm_debug_init(struct platform_device *pdev) {}
static inline void soctherm_debug_init(struct platform_device *pdev) {}