Skip to content

Commit a6906a8

Browse files
TinyWindzzjoergroedel
authored andcommitted
iommu/omap: Remove DEBUG_SEQ_FOPS_RO()
Because we already have the DEFINE_SHOW_ATTRIBUTE,there is no need to define such a macro.So remove DEBUG_SEQ_FOPS_RO. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent 9ff0119 commit a6906a8

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

drivers/iommu/omap-iommu-debug.c

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s)
159159
return 0;
160160
}
161161

162-
static int debug_read_tlb(struct seq_file *s, void *data)
162+
static int tlb_show(struct seq_file *s, void *data)
163163
{
164164
struct omap_iommu *obj = s->private;
165165

@@ -210,7 +210,7 @@ static void dump_ioptable(struct seq_file *s)
210210
spin_unlock(&obj->page_table_lock);
211211
}
212212

213-
static int debug_read_pagetable(struct seq_file *s, void *data)
213+
static int pagetable_show(struct seq_file *s, void *data)
214214
{
215215
struct omap_iommu *obj = s->private;
216216

@@ -228,35 +228,22 @@ static int debug_read_pagetable(struct seq_file *s, void *data)
228228
return 0;
229229
}
230230

231-
#define DEBUG_SEQ_FOPS_RO(name) \
232-
static int debug_open_##name(struct inode *inode, struct file *file) \
233-
{ \
234-
return single_open(file, debug_read_##name, inode->i_private); \
235-
} \
236-
\
237-
static const struct file_operations debug_##name##_fops = { \
238-
.open = debug_open_##name, \
239-
.read = seq_read, \
240-
.llseek = seq_lseek, \
241-
.release = single_release, \
242-
}
243-
244231
#define DEBUG_FOPS_RO(name) \
245-
static const struct file_operations debug_##name##_fops = { \
232+
static const struct file_operations name##_fops = { \
246233
.open = simple_open, \
247234
.read = debug_read_##name, \
248235
.llseek = generic_file_llseek, \
249236
}
250237

251238
DEBUG_FOPS_RO(regs);
252-
DEBUG_SEQ_FOPS_RO(tlb);
253-
DEBUG_SEQ_FOPS_RO(pagetable);
239+
DEFINE_SHOW_ATTRIBUTE(tlb);
240+
DEFINE_SHOW_ATTRIBUTE(pagetable);
254241

255242
#define __DEBUG_ADD_FILE(attr, mode) \
256243
{ \
257244
struct dentry *dent; \
258245
dent = debugfs_create_file(#attr, mode, obj->debug_dir, \
259-
obj, &debug_##attr##_fops); \
246+
obj, &attr##_fops); \
260247
if (!dent) \
261248
goto err; \
262249
}

0 commit comments

Comments
 (0)