summaryrefslogtreecommitdiff
path: root/drivers/mtd/mtdswap.c
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-02 11:33:58 +0300
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-12-03 13:32:26 +0300
commitc78f59d7145e7f729c8df58fa7f99ecf66225ddc (patch)
treed5043a0cc6b3d1f36712c87a414141416ac8dfed /drivers/mtd/mtdswap.c
parentbafae53817e7f3a47ed74cd03152e166aa639131 (diff)
downloadlinux-c78f59d7145e7f729c8df58fa7f99ecf66225ddc.tar.xz
mtd: use DEFINE_SHOW_ATTRIBUTE() instead of open-coding it
DEFINE_SHOW_ATTRIBUTE macro can help us simplify the code, so change to it. And change the DEBUGFS_RO_ATTR macro defined in some file to a standard macro. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/mtdswap.c')
-rw-r--r--drivers/mtd/mtdswap.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index d9dcb2d051b4..d162d1717fad 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1265,18 +1265,7 @@ static int mtdswap_show(struct seq_file *s, void *data)
return 0;
}
-
-static int mtdswap_open(struct inode *inode, struct file *file)
-{
- return single_open(file, mtdswap_show, inode->i_private);
-}
-
-static const struct file_operations mtdswap_fops = {
- .open = mtdswap_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(mtdswap);
static int mtdswap_add_debugfs(struct mtdswap_dev *d)
{