aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLiu Shixin <liushixin2@huawei.com>2022-09-22 22:25:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-24 13:05:41 +0200
commit9fabdbe8bcce08faaa51f618a87e3bf3ac264462 (patch)
treed631f5063df8b3d8923c6ac53890365abb786dda /drivers/staging
parentstaging: rtl8192u: Fix return type of ieee80211_xmit (diff)
downloadlinux-dev-9fabdbe8bcce08faaa51f618a87e3bf3ac264462.tar.xz
linux-dev-9fabdbe8bcce08faaa51f618a87e3bf3ac264462.zip
staging: pi433: use DEFINE_SHOW_ATTRIBUTE to simplify pi433_debugfs_regs
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. No functional change. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Link: https://lore.kernel.org/r/20220922142548.3248951-1-liushixin2@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/pi433/pi433_if.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index df02335fdbab..d4e06a3929f3 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1149,19 +1149,7 @@ out_unlock:
return ret;
}
-
-static int pi433_debugfs_regs_open(struct inode *inode, struct file *filp)
-{
- return single_open(filp, pi433_debugfs_regs_show, inode->i_private);
-}
-
-static const struct file_operations debugfs_fops = {
- .llseek = seq_lseek,
- .open = pi433_debugfs_regs_open,
- .owner = THIS_MODULE,
- .read = seq_read,
- .release = single_release
-};
+DEFINE_SHOW_ATTRIBUTE(pi433_debugfs_regs);
/*-------------------------------------------------------------------------*/
@@ -1320,7 +1308,7 @@ static int pi433_probe(struct spi_device *spi)
entry = debugfs_create_dir(dev_name(device->dev),
debugfs_lookup(KBUILD_MODNAME, NULL));
- debugfs_create_file("regs", 0400, entry, device, &debugfs_fops);
+ debugfs_create_file("regs", 0400, entry, device, &pi433_debugfs_regs_fops);
return 0;