forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/sound/soc/fsl/fsl_ssi_dbg.c
....@@ -78,7 +78,7 @@
7878 dbg->stats.tfe0++;
7979 }
8080
81
-/**
81
+/*
8282 * Show the statistics of a flag only if its interrupt is enabled
8383 *
8484 * Compilers will optimize it to a no-op if the interrupt is disabled
....@@ -90,7 +90,7 @@
9090 } while (0)
9191
9292
93
-/**
93
+/*
9494 * Display the statistics for the current SSI device
9595 *
9696 * To avoid confusion, only show those counts that are enabled
....@@ -124,37 +124,17 @@
124124 return 0;
125125 }
126126
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);
131128
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)
140130 {
141131 ssi_dbg->dbg_dir = debugfs_create_dir(dev_name(dev), NULL);
142
- if (!ssi_dbg->dbg_dir)
143
- return -ENOMEM;
144132
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);
154135 }
155136
156137 void fsl_ssi_debugfs_remove(struct fsl_ssi_dbg *ssi_dbg)
157138 {
158
- debugfs_remove(ssi_dbg->dbg_stats);
159
- debugfs_remove(ssi_dbg->dbg_dir);
139
+ debugfs_remove_recursive(ssi_dbg->dbg_dir);
160140 }