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

gpio: ks8695: 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: Linus Walleij <linus.walleij@linaro.org>

authored by

Yangtao Li and committed by
Linus Walleij
9904f032 25fbc9e8

+3 -12
+3 -12
drivers/gpio/gpio-ks8695.c
··· 282 282 return 0; 283 283 } 284 284 285 - static int ks8695_gpio_open(struct inode *inode, struct file *file) 286 - { 287 - return single_open(file, ks8695_gpio_show, NULL); 288 - } 289 - 290 - static const struct file_operations ks8695_gpio_operations = { 291 - .open = ks8695_gpio_open, 292 - .read = seq_read, 293 - .llseek = seq_lseek, 294 - .release = single_release, 295 - }; 285 + DEFINE_SHOW_ATTRIBUTE(ks8695_gpio); 296 286 297 287 static int __init ks8695_gpio_debugfs_init(void) 298 288 { 299 289 /* /sys/kernel/debug/ks8695_gpio */ 300 - (void) debugfs_create_file("ks8695_gpio", S_IFREG | S_IRUGO, NULL, NULL, &ks8695_gpio_operations); 290 + debugfs_create_file("ks8695_gpio", S_IFREG | S_IRUGO, NULL, NULL, 291 + &ks8695_gpio_fops); 301 292 return 0; 302 293 } 303 294 postcore_initcall(ks8695_gpio_debugfs_init);