diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2018-12-15 03:36:36 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-20 10:33:18 -0500 |
commit | c0b8a8709ebe0f72523a1e76f30a1bde821c060c (patch) | |
tree | 11c23f37f9266f80aa5a998abeba05db27b0b967 /drivers/base/component.c | |
parent | 4f4b374332ec0ae9c738ff8ec9bed5cd97ff9adc (diff) |
component: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/component.c')
-rw-r--r-- | drivers/base/component.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c index e8d676fad0c9..ddcea8739c12 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c | |||
@@ -85,17 +85,7 @@ static int component_devices_show(struct seq_file *s, void *data) | |||
85 | return 0; | 85 | return 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | static int component_devices_open(struct inode *inode, struct file *file) | 88 | DEFINE_SHOW_ATTRIBUTE(component_devices); |
89 | { | ||
90 | return single_open(file, component_devices_show, inode->i_private); | ||
91 | } | ||
92 | |||
93 | static const struct file_operations component_devices_fops = { | ||
94 | .open = component_devices_open, | ||
95 | .read = seq_read, | ||
96 | .llseek = seq_lseek, | ||
97 | .release = single_release, | ||
98 | }; | ||
99 | 89 | ||
100 | static int __init component_debug_init(void) | 90 | static int __init component_debug_init(void) |
101 | { | 91 | { |