Commit 2773eb2f authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij

gpio: tegra: Convert to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4b7edaef
...@@ -506,7 +506,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable) ...@@ -506,7 +506,7 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
static int dbg_gpio_show(struct seq_file *s, void *unused) static int tegra_dbg_gpio_show(struct seq_file *s, void *unused)
{ {
struct tegra_gpio_info *tgi = s->private; struct tegra_gpio_info *tgi = s->private;
unsigned int i, j; unsigned int i, j;
...@@ -530,22 +530,12 @@ static int dbg_gpio_show(struct seq_file *s, void *unused) ...@@ -530,22 +530,12 @@ static int dbg_gpio_show(struct seq_file *s, void *unused)
return 0; return 0;
} }
static int dbg_gpio_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(tegra_dbg_gpio);
{
return single_open(file, dbg_gpio_show, inode->i_private);
}
static const struct file_operations debug_fops = {
.open = dbg_gpio_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi) static void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)
{ {
(void) debugfs_create_file("tegra_gpio", 0444, (void) debugfs_create_file("tegra_gpio", 0444,
NULL, tgi, &debug_fops); NULL, tgi, &tegra_dbg_gpio_fops);
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment