Skip to content

Commit 6980bc0

Browse files
author
Myron Stowe
committed
PCI/PTM: Build debugfs code only if CONFIG_DEBUG_FS is enabled
JIRA: https://issues.redhat.com/browse/RHEL-107597 Upstream Status: 5aa326a commit 5aa326a Author: Manivannan Sadhasivam <mani@kernel.org> Date: Sun Jun 8 09:03:05 2025 +0530 PCI/PTM: Build debugfs code only if CONFIG_DEBUG_FS is enabled Otherwise, the following build error will happen for CONFIG_DEBUG_FS=n && CONFIG_PCIE_PTM=y: drivers/pci/pcie/ptm.c:498:25: error: redefinition of 'pcie_ptm_create_debugfs' 498 | struct pci_ptm_debugfs *pcie_ptm_create_debugfs(struct device *dev, void *pdata, | ^ ./include/linux/pci.h:1915:2: note: previous definition is here 1915 | *pcie_ptm_create_debugfs(struct device *dev, void *pdata, | ^ drivers/pci/pcie/ptm.c:546:6: error: redefinition of 'pcie_ptm_destroy_debugfs' 546 | void pcie_ptm_destroy_debugfs(struct pci_ptm_debugfs *ptm_debugfs) | ^ ./include/linux/pci.h:1918:1: note: previous definition is here 1918 | pcie_ptm_destroy_debugfs(struct pci_ptm_debugfs *ptm_debugfs) { } | Fixes: 1328334 ("PCI: Add debugfs support for exposing PTM context") Reported-by: Eric Biggers <ebiggers@kernel.org> Closes: https://lore.kernel.org/linux-pci/20250607025506.GA16607@sol Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Eric Biggers <ebiggers@kernel.org> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Link: https://patch.msgid.link/20250608033305.15214-1-manivannan.sadhasivam@linaro.org Signed-off-by: Myron Stowe <mstowe@redhat.com>
1 parent 87befb0 commit 6980bc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pci/pcie/ptm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ bool pcie_ptm_enabled(struct pci_dev *dev)
254254
}
255255
EXPORT_SYMBOL(pcie_ptm_enabled);
256256

257+
#if IS_ENABLED(CONFIG_DEBUG_FS)
257258
static ssize_t context_update_write(struct file *file, const char __user *ubuf,
258259
size_t count, loff_t *ppos)
259260
{
@@ -552,3 +553,4 @@ void pcie_ptm_destroy_debugfs(struct pci_ptm_debugfs *ptm_debugfs)
552553
debugfs_remove_recursive(ptm_debugfs->debugfs);
553554
}
554555
EXPORT_SYMBOL_GPL(pcie_ptm_destroy_debugfs);
556+
#endif

0 commit comments

Comments
 (0)