Skip to content

Commit 0b24a0b

Browse files
andy-shevMarc Zyngier
authored andcommitted
irqdomain: Re-use DEFINE_SHOW_ATTRIBUTE() macro
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 2d02424 commit 0b24a0b

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

kernel/irq/irqdomain.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,25 +1726,14 @@ static int irq_domain_debug_show(struct seq_file *m, void *p)
17261726
irq_domain_debug_show_one(m, d, 0);
17271727
return 0;
17281728
}
1729-
1730-
static int irq_domain_debug_open(struct inode *inode, struct file *file)
1731-
{
1732-
return single_open(file, irq_domain_debug_show, inode->i_private);
1733-
}
1734-
1735-
static const struct file_operations dfs_domain_ops = {
1736-
.open = irq_domain_debug_open,
1737-
.read = seq_read,
1738-
.llseek = seq_lseek,
1739-
.release = single_release,
1740-
};
1729+
DEFINE_SHOW_ATTRIBUTE(irq_domain_debug);
17411730

17421731
static void debugfs_add_domain_dir(struct irq_domain *d)
17431732
{
17441733
if (!d->name || !domain_dir || d->debugfs_file)
17451734
return;
17461735
d->debugfs_file = debugfs_create_file(d->name, 0444, domain_dir, d,
1747-
&dfs_domain_ops);
1736+
&irq_domain_debug_fops);
17481737
}
17491738

17501739
static void debugfs_remove_domain_dir(struct irq_domain *d)
@@ -1760,7 +1749,8 @@ void __init irq_domain_debugfs_init(struct dentry *root)
17601749
if (!domain_dir)
17611750
return;
17621751

1763-
debugfs_create_file("default", 0444, domain_dir, NULL, &dfs_domain_ops);
1752+
debugfs_create_file("default", 0444, domain_dir, NULL,
1753+
&irq_domain_debug_fops);
17641754
mutex_lock(&irq_domain_mutex);
17651755
list_for_each_entry(d, &irq_domain_list, link)
17661756
debugfs_add_domain_dir(d);

0 commit comments

Comments
 (0)