@@ -159,7 +159,7 @@ static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s)
159
159
return 0 ;
160
160
}
161
161
162
- static int debug_read_tlb (struct seq_file * s , void * data )
162
+ static int tlb_show (struct seq_file * s , void * data )
163
163
{
164
164
struct omap_iommu * obj = s -> private ;
165
165
@@ -210,7 +210,7 @@ static void dump_ioptable(struct seq_file *s)
210
210
spin_unlock (& obj -> page_table_lock );
211
211
}
212
212
213
- static int debug_read_pagetable (struct seq_file * s , void * data )
213
+ static int pagetable_show (struct seq_file * s , void * data )
214
214
{
215
215
struct omap_iommu * obj = s -> private ;
216
216
@@ -228,35 +228,22 @@ static int debug_read_pagetable(struct seq_file *s, void *data)
228
228
return 0 ;
229
229
}
230
230
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
-
244
231
#define DEBUG_FOPS_RO (name ) \
245
- static const struct file_operations debug_## name##_fops = { \
232
+ static const struct file_operations name##_fops = { \
246
233
.open = simple_open, \
247
234
.read = debug_read_##name, \
248
235
.llseek = generic_file_llseek, \
249
236
}
250
237
251
238
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 );
254
241
255
242
#define __DEBUG_ADD_FILE (attr , mode ) \
256
243
{ \
257
244
struct dentry *dent; \
258
245
dent = debugfs_create_file(#attr, mode, obj->debug_dir, \
259
- obj, &debug_## attr##_fops); \
246
+ obj, &attr##_fops); \
260
247
if (!dent) \
261
248
goto err; \
262
249
}
0 commit comments