Commit d27b1cdc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Lorenzo Pieralisi

PCI: 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.

Link: https://lore.kernel.org/r/20200818133739.463193-1-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Vidya Sagar <vidyas@nvidia.com>
Cc: Andrew Murray <amurray@thegoodpenguin.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-pci@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
parent 9123e3a7
...@@ -699,23 +699,16 @@ static void init_host_aspm(struct tegra_pcie_dw *pcie) ...@@ -699,23 +699,16 @@ static void init_host_aspm(struct tegra_pcie_dw *pcie)
dw_pcie_writel_dbi(pci, PORT_LOGIC_ACK_F_ASPM_CTRL, val); dw_pcie_writel_dbi(pci, PORT_LOGIC_ACK_F_ASPM_CTRL, val);
} }
static int init_debugfs(struct tegra_pcie_dw *pcie) static void init_debugfs(struct tegra_pcie_dw *pcie)
{ {
struct dentry *d; debugfs_create_devm_seqfile(pcie->dev, "aspm_state_cnt", pcie->debugfs,
aspm_state_cnt);
d = debugfs_create_devm_seqfile(pcie->dev, "aspm_state_cnt",
pcie->debugfs, aspm_state_cnt);
if (IS_ERR_OR_NULL(d))
dev_err(pcie->dev,
"Failed to create debugfs file \"aspm_state_cnt\"\n");
return 0;
} }
#else #else
static inline void disable_aspm_l12(struct tegra_pcie_dw *pcie) { return; } static inline void disable_aspm_l12(struct tegra_pcie_dw *pcie) { return; }
static inline void disable_aspm_l11(struct tegra_pcie_dw *pcie) { return; } static inline void disable_aspm_l11(struct tegra_pcie_dw *pcie) { return; }
static inline void init_host_aspm(struct tegra_pcie_dw *pcie) { return; } static inline void init_host_aspm(struct tegra_pcie_dw *pcie) { return; }
static inline int init_debugfs(struct tegra_pcie_dw *pcie) { return 0; } static inline void init_debugfs(struct tegra_pcie_dw *pcie) { return; }
#endif #endif
static void tegra_pcie_enable_system_interrupts(struct pcie_port *pp) static void tegra_pcie_enable_system_interrupts(struct pcie_port *pp)
...@@ -1641,9 +1634,6 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie) ...@@ -1641,9 +1634,6 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
} }
pcie->debugfs = debugfs_create_dir(name, NULL); pcie->debugfs = debugfs_create_dir(name, NULL);
if (!pcie->debugfs)
dev_err(dev, "Failed to create debugfs\n");
else
init_debugfs(pcie); init_debugfs(pcie);
return ret; return ret;
......
...@@ -2601,24 +2601,12 @@ static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie) ...@@ -2601,24 +2601,12 @@ static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie)
pcie->debugfs = NULL; pcie->debugfs = NULL;
} }
static int tegra_pcie_debugfs_init(struct tegra_pcie *pcie) static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie)
{ {
struct dentry *file;
pcie->debugfs = debugfs_create_dir("pcie", NULL); pcie->debugfs = debugfs_create_dir("pcie", NULL);
if (!pcie->debugfs)
return -ENOMEM;
file = debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs,
pcie, &tegra_pcie_ports_ops);
if (!file)
goto remove;
return 0;
remove: debugfs_create_file("ports", S_IFREG | S_IRUGO, pcie->debugfs, pcie,
tegra_pcie_debugfs_exit(pcie); &tegra_pcie_ports_ops);
return -ENOMEM;
} }
static int tegra_pcie_probe(struct platform_device *pdev) static int tegra_pcie_probe(struct platform_device *pdev)
...@@ -2672,11 +2660,8 @@ static int tegra_pcie_probe(struct platform_device *pdev) ...@@ -2672,11 +2660,8 @@ static int tegra_pcie_probe(struct platform_device *pdev)
goto pm_runtime_put; goto pm_runtime_put;
} }
if (IS_ENABLED(CONFIG_DEBUG_FS)) { if (IS_ENABLED(CONFIG_DEBUG_FS))
err = tegra_pcie_debugfs_init(pcie); tegra_pcie_debugfs_init(pcie);
if (err < 0)
dev_err(dev, "failed to setup debugfs: %d\n", err);
}
return 0; return 0;
......
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