drivers/pci/controller/dwc/pcie-designware-debugfs.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
Replace the custom open function and file_operations with the
standard DEFINE_SHOW_ATTRIBUTE macro to reduce boilerplate code.
No functional change intended.
Signed-off-by: Hans Zhang <18255117159@163.com>
---
drivers/pci/controller/dwc/pcie-designware-debugfs.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-debugfs.c b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
index d0884253be97..87f5ec9c48eb 100644
--- a/drivers/pci/controller/dwc/pcie-designware-debugfs.c
+++ b/drivers/pci/controller/dwc/pcie-designware-debugfs.c
@@ -507,11 +507,6 @@ static int ltssm_status_show(struct seq_file *s, void *v)
return 0;
}
-static int ltssm_status_open(struct inode *inode, struct file *file)
-{
- return single_open(file, ltssm_status_show, inode->i_private);
-}
-
#define dwc_debugfs_create(name) \
debugfs_create_file(#name, 0644, rasdes_debug, pci, \
&dbg_ ## name ## _fops)
@@ -548,10 +543,7 @@ static const struct file_operations dwc_pcie_counter_value_ops = {
.read = counter_value_read,
};
-static const struct file_operations dwc_pcie_ltssm_status_ops = {
- .open = ltssm_status_open,
- .read = seq_read,
-};
+DEFINE_SHOW_ATTRIBUTE(ltssm_status);
static void dwc_pcie_rasdes_debugfs_deinit(struct dw_pcie *pci)
{
@@ -642,7 +634,7 @@ static int dwc_pcie_rasdes_debugfs_init(struct dw_pcie *pci, struct dentry *dir)
static void dwc_pcie_ltssm_debugfs_init(struct dw_pcie *pci, struct dentry *dir)
{
debugfs_create_file("ltssm_status", 0444, dir, pci,
- &dwc_pcie_ltssm_status_ops);
+ <ssm_status_fops);
}
static int dw_pcie_ptm_check_capability(void *drvdata)
--
2.34.1
On Fri, 08 May 2026 21:34:32 +0800, Hans Zhang wrote:
> Replace the custom open function and file_operations with the
> standard DEFINE_SHOW_ATTRIBUTE macro to reduce boilerplate code.
>
> No functional change intended.
>
>
Applied, thanks!
[1/1] PCI: dwc: Use DEFINE_SHOW_ATTRIBUTE for ltssm_status debugfs
commit: d25f1dd6b986070e2324bf373097f0fced1e57e1
Best regards,
--
Manivannan Sadhasivam <mani@kernel.org>
© 2016 - 2026 Red Hat, Inc.