.. | .. |
---|
78 | 78 | dbg->stats.tfe0++; |
---|
79 | 79 | } |
---|
80 | 80 | |
---|
81 | | -/** |
---|
| 81 | +/* |
---|
82 | 82 | * Show the statistics of a flag only if its interrupt is enabled |
---|
83 | 83 | * |
---|
84 | 84 | * Compilers will optimize it to a no-op if the interrupt is disabled |
---|
.. | .. |
---|
90 | 90 | } while (0) |
---|
91 | 91 | |
---|
92 | 92 | |
---|
93 | | -/** |
---|
| 93 | +/* |
---|
94 | 94 | * Display the statistics for the current SSI device |
---|
95 | 95 | * |
---|
96 | 96 | * To avoid confusion, only show those counts that are enabled |
---|
.. | .. |
---|
124 | 124 | return 0; |
---|
125 | 125 | } |
---|
126 | 126 | |
---|
127 | | -static int fsl_ssi_stats_open(struct inode *inode, struct file *file) |
---|
128 | | -{ |
---|
129 | | - return single_open(file, fsl_ssi_stats_show, inode->i_private); |
---|
130 | | -} |
---|
| 127 | +DEFINE_SHOW_ATTRIBUTE(fsl_ssi_stats); |
---|
131 | 128 | |
---|
132 | | -static const struct file_operations fsl_ssi_stats_ops = { |
---|
133 | | - .open = fsl_ssi_stats_open, |
---|
134 | | - .read = seq_read, |
---|
135 | | - .llseek = seq_lseek, |
---|
136 | | - .release = single_release, |
---|
137 | | -}; |
---|
138 | | - |
---|
139 | | -int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) |
---|
| 129 | +void fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) |
---|
140 | 130 | { |
---|
141 | 131 | ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL); |
---|
142 | | - if (!ssi_dbg->dbg_dir) |
---|
143 | | - return -ENOMEM; |
---|
144 | 132 | |
---|
145 | | - ssi_dbg->dbg_stats = debugfs_create_file("stats", 0444, |
---|
146 | | - ssi_dbg->dbg_dir, ssi_dbg, |
---|
147 | | - &fsl_ssi_stats_ops); |
---|
148 | | - if (!ssi_dbg->dbg_stats) { |
---|
149 | | - debugfs_remove(ssi_dbg->dbg_dir); |
---|
150 | | - return -ENOMEM; |
---|
151 | | - } |
---|
152 | | - |
---|
153 | | - return 0; |
---|
| 133 | + debugfs_create_file("stats", 0444, ssi_dbg->dbg_dir, ssi_dbg, |
---|
| 134 | + &fsl_ssi_stats_fops); |
---|
154 | 135 | } |
---|
155 | 136 | |
---|
156 | 137 | void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg) |
---|
157 | 138 | { |
---|
158 | | - debugfs_remove(ssi_dbg->dbg_stats); |
---|
159 | | - debugfs_remove(ssi_dbg->dbg_dir); |
---|
| 139 | + debugfs_remove_recursive(ssi_dbg->dbg_dir); |
---|
160 | 140 | } |
---|