Commit 943a10f8 authored by Yangtao Li's avatar Yangtao Li Committed by Rafael J. Wysocki
Browse files

PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE



Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 40e020c1
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -318,23 +318,12 @@ static int suspend_stats_show(struct seq_file *s, void *unused)

	return 0;
}

static int suspend_stats_open(struct inode *inode, struct file *file)
{
	return single_open(file, suspend_stats_show, NULL);
}

static const struct file_operations suspend_stats_operations = {
	.open           = suspend_stats_open,
	.read           = seq_read,
	.llseek         = seq_lseek,
	.release        = single_release,
};
DEFINE_SHOW_ATTRIBUTE(suspend_stats);

static int __init pm_debugfs_init(void)
{
	debugfs_create_file("suspend_stats", S_IFREG | S_IRUGO,
			NULL, NULL, &suspend_stats_operations);
			NULL, NULL, &suspend_stats_fops);
	return 0;
}