Skip to content

Commit 8c32d47

Browse files
TinyWindzzJiri Kosina
authored andcommitted
HID: debug: 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: Jiri Kosina <jkosina@suse.cz>
1 parent f5d5827 commit 8c32d47

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

‎drivers/hid/hid-debug.c‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,11 +1072,6 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
10721072
return 0;
10731073
}
10741074

1075-
static int hid_debug_rdesc_open(struct inode *inode, struct file *file)
1076-
{
1077-
return single_open(file, hid_debug_rdesc_show, inode->i_private);
1078-
}
1079-
10801075
static int hid_debug_events_open(struct inode *inode, struct file *file)
10811076
{
10821077
int err = 0;
@@ -1211,12 +1206,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)
12111206
return 0;
12121207
}
12131208

1214-
static const struct file_operations hid_debug_rdesc_fops = {
1215-
.open = hid_debug_rdesc_open,
1216-
.read = seq_read,
1217-
.llseek = seq_lseek,
1218-
.release = single_release,
1219-
};
1209+
DEFINE_SHOW_ATTRIBUTE(hid_debug_rdesc);
12201210

12211211
static const struct file_operations hid_debug_events_fops = {
12221212
.owner = THIS_MODULE,

0 commit comments

Comments
 (0)