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

char: virtio: 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Yangtao Li and committed by
Greg Kroah-Hartman
ddfa728a c13e0a52

+3 -14
+3 -14
drivers/char/virtio_console.c
··· 1309 1309 .attrs = port_sysfs_entries, 1310 1310 }; 1311 1311 1312 - static int debugfs_show(struct seq_file *s, void *data) 1312 + static int port_debugfs_show(struct seq_file *s, void *data) 1313 1313 { 1314 1314 struct port *port = s->private; 1315 1315 ··· 1327 1327 return 0; 1328 1328 } 1329 1329 1330 - static int debugfs_open(struct inode *inode, struct file *file) 1331 - { 1332 - return single_open(file, debugfs_show, inode->i_private); 1333 - } 1334 - 1335 - static const struct file_operations port_debugfs_ops = { 1336 - .owner = THIS_MODULE, 1337 - .open = debugfs_open, 1338 - .read = seq_read, 1339 - .llseek = seq_lseek, 1340 - .release = single_release, 1341 - }; 1330 + DEFINE_SHOW_ATTRIBUTE(port_debugfs); 1342 1331 1343 1332 static void set_console_size(struct port *port, u16 rows, u16 cols) 1344 1333 { ··· 1479 1490 port->debugfs_file = debugfs_create_file(debugfs_name, 0444, 1480 1491 pdrvdata.debugfs_dir, 1481 1492 port, 1482 - &port_debugfs_ops); 1493 + &port_debugfs_fops); 1483 1494 } 1484 1495 return 0; 1485 1496