diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2018-11-30 11:11:01 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-12-24 11:17:04 +0100 |
commit | 2674305a1f5a5356e3c4488d90aab2654142ee99 (patch) | |
tree | 9d2f5e53583aa9ca03731b5144fdeefb7578cd68 /drivers/dma-buf/sync_debug.c | |
parent | 70bce993a7aa57c00798d8f13ebbbddd81cbbef9 (diff) | |
download | linux-stable-2674305a1f5a5356e3c4488d90aab2654142ee99.tar.gz linux-stable-2674305a1f5a5356e3c4488d90aab2654142ee99.tar.bz2 linux-stable-2674305a1f5a5356e3c4488d90aab2654142ee99.zip |
dma-buf: Change to use DEFINE_SHOW_ATTRIBUTE macro
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181130161101.3413-1-tiny.windzz@gmail.com
Diffstat (limited to 'drivers/dma-buf/sync_debug.c')
-rw-r--r-- | drivers/dma-buf/sync_debug.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index c4c8ecb24aa9..c0abf37df88b 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -147,7 +147,7 @@ static void sync_print_sync_file(struct seq_file *s, } } -static int sync_debugfs_show(struct seq_file *s, void *unused) +static int sync_info_debugfs_show(struct seq_file *s, void *unused) { struct list_head *pos; @@ -178,17 +178,7 @@ static int sync_debugfs_show(struct seq_file *s, void *unused) return 0; } -static int sync_info_debugfs_open(struct inode *inode, struct file *file) -{ - return single_open(file, sync_debugfs_show, inode->i_private); -} - -static const struct file_operations sync_info_debugfs_fops = { - .open = sync_info_debugfs_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(sync_info_debugfs); static __init int sync_debugfs_init(void) { @@ -218,7 +208,7 @@ void sync_dump(void) }; int i; - sync_debugfs_show(&s, NULL); + sync_info_debugfs_show(&s, NULL); for (i = 0; i < s.count; i += DUMP_CHUNK) { if ((s.count - i) > DUMP_CHUNK) { |