Commit b21dc631 authored by Liu Shixin's avatar Liu Shixin Committed by Herbert Xu

crypto: sun4i-ss - use DEFINE_SHOW_ATTRIBUTE to simplify sun4i_ss_debugfs

Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code.
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
Acked-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c4b1ce72
...@@ -235,7 +235,7 @@ static struct sun4i_ss_alg_template ss_algs[] = { ...@@ -235,7 +235,7 @@ static struct sun4i_ss_alg_template ss_algs[] = {
#endif #endif
}; };
static int sun4i_ss_dbgfs_read(struct seq_file *seq, void *v) static int sun4i_ss_debugfs_show(struct seq_file *seq, void *v)
{ {
unsigned int i; unsigned int i;
...@@ -266,19 +266,7 @@ static int sun4i_ss_dbgfs_read(struct seq_file *seq, void *v) ...@@ -266,19 +266,7 @@ static int sun4i_ss_dbgfs_read(struct seq_file *seq, void *v)
} }
return 0; return 0;
} }
DEFINE_SHOW_ATTRIBUTE(sun4i_ss_debugfs);
static int sun4i_ss_dbgfs_open(struct inode *inode, struct file *file)
{
return single_open(file, sun4i_ss_dbgfs_read, inode->i_private);
}
static const struct file_operations sun4i_ss_debugfs_fops = {
.owner = THIS_MODULE,
.open = sun4i_ss_dbgfs_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
/* /*
* Power management strategy: The device is suspended unless a TFM exists for * Power management strategy: The device is suspended unless a TFM exists for
......
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