Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mips: ralink: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Liu Shixin and committed by
Thomas Bogendoerfer
53f9cd5c 27a43a85

+2 -13
+2 -13
arch/mips/ralink/bootrom.c
··· 18 18 19 19 return 0; 20 20 } 21 - 22 - static int bootrom_open(struct inode *inode, struct file *file) 23 - { 24 - return single_open(file, bootrom_show, NULL); 25 - } 26 - 27 - static const struct file_operations bootrom_file_ops = { 28 - .open = bootrom_open, 29 - .read = seq_read, 30 - .llseek = seq_lseek, 31 - .release = single_release, 32 - }; 21 + DEFINE_SHOW_ATTRIBUTE(bootrom); 33 22 34 23 static int __init bootrom_setup(void) 35 24 { 36 - debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops); 25 + debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_fops); 37 26 return 0; 38 27 } 39 28