Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 248e655b authored by Yangtao Li's avatar Yangtao Li Committed by Wim Van Sebroeck
Browse files

watchdog: ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE



Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 57808f44
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static struct watchdog_device ie6xx_wdt_dev = {

#ifdef CONFIG_DEBUG_FS

static int ie6xx_wdt_dbg_show(struct seq_file *s, void *unused)
static int ie6xx_wdt_show(struct seq_file *s, void *unused)
{
	seq_printf(s, "PV1   = 0x%08x\n",
		inl(ie6xx_wdt_data.sch_wdtba + PV1));
@@ -212,23 +212,13 @@ static int ie6xx_wdt_dbg_show(struct seq_file *s, void *unused)
	return 0;
}

static int ie6xx_wdt_dbg_open(struct inode *inode, struct file *file)
{
	return single_open(file, ie6xx_wdt_dbg_show, NULL);
}

static const struct file_operations ie6xx_wdt_dbg_operations = {
	.open		= ie6xx_wdt_dbg_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};
DEFINE_SHOW_ATTRIBUTE(ie6xx_wdt);

static void ie6xx_wdt_debugfs_init(void)
{
	/* /sys/kernel/debug/ie6xx_wdt */
	ie6xx_wdt_data.debugfs = debugfs_create_file("ie6xx_wdt",
		S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_dbg_operations);
		S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_fops);
}

static void ie6xx_wdt_debugfs_exit(void)