mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
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>
This commit is contained in:
parent
f5d582777b
commit
8c32d47b15
@ -1072,11 +1072,6 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hid_debug_rdesc_open(struct inode *inode, struct file *file)
|
|
||||||
{
|
|
||||||
return single_open(file, hid_debug_rdesc_show, inode->i_private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int hid_debug_events_open(struct inode *inode, struct file *file)
|
static int hid_debug_events_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
@ -1211,12 +1206,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations hid_debug_rdesc_fops = {
|
DEFINE_SHOW_ATTRIBUTE(hid_debug_rdesc);
|
||||||
.open = hid_debug_rdesc_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = single_release,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct file_operations hid_debug_events_fops = {
|
static const struct file_operations hid_debug_events_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
Loading…
Reference in New Issue
Block a user