Skip to content

Commit 9d832cd

Browse files
Yongqiang Liusre
authored andcommitted
power: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yongqiang Liu <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent f03a349 commit 9d832cd

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/power/supply/da9030_battery.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,7 @@ static int bat_debug_show(struct seq_file *s, void *data)
172172
return 0;
173173
}
174174

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);
186176

187177
static struct dentry *da9030_bat_create_debugfs(struct da9030_charger *charger)
188178
{

0 commit comments

Comments
 (0)