diff options
| author | Yangtao Li <tiny.windzz@gmail.com> | 2018-11-22 08:54:43 -0500 |
|---|---|---|
| committer | Joerg Roedel <jroedel@suse.de> | 2018-11-22 11:10:43 -0500 |
| commit | a6906a8b0ebfbf6330847ba640c8dde8aca679be (patch) | |
| tree | 70b1b233b6e44aea496fb3c5a164ad80ba9ba027 | |
| parent | 9ff01193a20d391e8dbce4403dd5ef87c7eaaca6 (diff) | |
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 <tiny.windzz@gmail.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
| -rw-r--r-- | drivers/iommu/omap-iommu-debug.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/iommu/omap-iommu-debug.c b/drivers/iommu/omap-iommu-debug.c index 50217548c3b8..4abc0ef522a8 100644 --- a/drivers/iommu/omap-iommu-debug.c +++ b/drivers/iommu/omap-iommu-debug.c | |||
| @@ -159,7 +159,7 @@ static size_t omap_dump_tlb_entries(struct omap_iommu *obj, struct seq_file *s) | |||
| 159 | return 0; | 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 | struct omap_iommu *obj = s->private; | 164 | struct omap_iommu *obj = s->private; |
| 165 | 165 | ||
| @@ -210,7 +210,7 @@ static void dump_ioptable(struct seq_file *s) | |||
| 210 | spin_unlock(&obj->page_table_lock); | 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 | struct omap_iommu *obj = s->private; | 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 | return 0; | 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 | #define DEBUG_FOPS_RO(name) \ | 231 | #define DEBUG_FOPS_RO(name) \ |
| 245 | static const struct file_operations debug_##name##_fops = { \ | 232 | static const struct file_operations name##_fops = { \ |
| 246 | .open = simple_open, \ | 233 | .open = simple_open, \ |
| 247 | .read = debug_read_##name, \ | 234 | .read = debug_read_##name, \ |
| 248 | .llseek = generic_file_llseek, \ | 235 | .llseek = generic_file_llseek, \ |
| 249 | } | 236 | } |
| 250 | 237 | ||
| 251 | DEBUG_FOPS_RO(regs); | 238 | DEBUG_FOPS_RO(regs); |
| 252 | DEBUG_SEQ_FOPS_RO(tlb); | 239 | DEFINE_SHOW_ATTRIBUTE(tlb); |
| 253 | DEBUG_SEQ_FOPS_RO(pagetable); | 240 | DEFINE_SHOW_ATTRIBUTE(pagetable); |
| 254 | 241 | ||
| 255 | #define __DEBUG_ADD_FILE(attr, mode) \ | 242 | #define __DEBUG_ADD_FILE(attr, mode) \ |
| 256 | { \ | 243 | { \ |
| 257 | struct dentry *dent; \ | 244 | struct dentry *dent; \ |
| 258 | dent = debugfs_create_file(#attr, mode, obj->debug_dir, \ | 245 | dent = debugfs_create_file(#attr, mode, obj->debug_dir, \ |
| 259 | obj, &debug_##attr##_fops); \ | 246 | obj, &attr##_fops); \ |
| 260 | if (!dent) \ | 247 | if (!dent) \ |
| 261 | goto err; \ | 248 | goto err; \ |
| 262 | } | 249 | } |
