Commit d3ff06b0 authored by Yangtao Li's avatar Yangtao Li Committed by Mark Brown

ASoC: fsl_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f69f4522
...@@ -124,17 +124,7 @@ static int fsl_ssi_stats_show(struct seq_file *s, void *unused) ...@@ -124,17 +124,7 @@ static int fsl_ssi_stats_show(struct seq_file *s, void *unused)
return 0; return 0;
} }
static int fsl_ssi_stats_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(fsl_ssi_stats);
{
return single_open(file, fsl_ssi_stats_show, inode->i_private);
}
static const struct file_operations fsl_ssi_stats_ops = {
.open = fsl_ssi_stats_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
{ {
...@@ -144,7 +134,7 @@ int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev) ...@@ -144,7 +134,7 @@ int fsl_ssi_debugfs_create(struct fsl_ssi_dbg *ssi_dbg, struct device *dev)
ssi_dbg->dbg_stats = debugfs_create_file("stats", 0444, ssi_dbg->dbg_stats = debugfs_create_file("stats", 0444,
ssi_dbg->dbg_dir, ssi_dbg, ssi_dbg->dbg_dir, ssi_dbg,
&fsl_ssi_stats_ops); &fsl_ssi_stats_fops);
if (!ssi_dbg->dbg_stats) { if (!ssi_dbg->dbg_stats) {
debugfs_remove(ssi_dbg->dbg_dir); debugfs_remove(ssi_dbg->dbg_dir);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment