Merge branch 'pci/controller/tegra194'

- Create debugfs directory for 'aspm_state_cnt' only when CONFIG_PCIEASPM
  is enabled, since there are no other entries (Hans Zhang)

* pci/controller/tegra194:
  PCI: tegra194: Create debugfs directory only when CONFIG_PCIEASPM is enabled
This commit is contained in:
Bjorn Helgaas 2025-06-04 10:50:43 -05:00
commit df52b63940

View File

@ -713,7 +713,16 @@ static void init_host_aspm(struct tegra_pcie_dw *pcie)
static void init_debugfs(struct tegra_pcie_dw *pcie)
{
debugfs_create_devm_seqfile(pcie->dev, "aspm_state_cnt", pcie->debugfs,
struct device *dev = pcie->dev;
char *name;
name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
if (!name)
return;
pcie->debugfs = debugfs_create_dir(name, NULL);
debugfs_create_devm_seqfile(dev, "aspm_state_cnt", pcie->debugfs,
aspm_state_cnt);
}
#else
@ -1634,7 +1643,6 @@ static void tegra_pcie_deinit_controller(struct tegra_pcie_dw *pcie)
static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
{
struct device *dev = pcie->dev;
char *name;
int ret;
pm_runtime_enable(dev);
@ -1664,13 +1672,6 @@ static int tegra_pcie_config_rp(struct tegra_pcie_dw *pcie)
goto fail_host_init;
}
name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
if (!name) {
ret = -ENOMEM;
goto fail_host_init;
}
pcie->debugfs = debugfs_create_dir(name, NULL);
init_debugfs(pcie);
return ret;