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

power: Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Yongqiang Liu and committed by
Sebastian Reichel
9d832cd3 f03a3497

+1 -11
+1 -11
drivers/power/supply/da9030_battery.c
··· 172 172 return 0; 173 173 } 174 174 175 - static int debug_open(struct inode *inode, struct file *file) 176 - { 177 - return single_open(file, bat_debug_show, inode->i_private); 178 - } 179 - 180 - static const struct file_operations bat_debug_fops = { 181 - .open = debug_open, 182 - .read = seq_read, 183 - .llseek = seq_lseek, 184 - .release = single_release, 185 - }; 175 + DEFINE_SHOW_ATTRIBUTE(bat_debug); 186 176 187 177 static struct dentry *da9030_bat_create_debugfs(struct da9030_charger *charger) 188 178 {