mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
crypto: qat - convert to use DEFINE_SEQ_ATTRIBUTE macro
Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
255f6c2e74
commit
406d454bc8
2 changed files with 5 additions and 56 deletions
|
@ -52,24 +52,7 @@ static const struct seq_operations qat_dev_cfg_sops = {
|
|||
.show = qat_dev_cfg_show
|
||||
};
|
||||
|
||||
static int qat_dev_cfg_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int ret = seq_open(file, &qat_dev_cfg_sops);
|
||||
|
||||
if (!ret) {
|
||||
struct seq_file *seq_f = file->private_data;
|
||||
|
||||
seq_f->private = inode->i_private;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations qat_dev_cfg_fops = {
|
||||
.open = qat_dev_cfg_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release
|
||||
};
|
||||
DEFINE_SEQ_ATTRIBUTE(qat_dev_cfg);
|
||||
|
||||
/**
|
||||
* adf_cfg_dev_add() - Create an acceleration device configuration table.
|
||||
|
|
|
@ -77,31 +77,14 @@ static void adf_ring_stop(struct seq_file *sfile, void *v)
|
|||
mutex_unlock(&ring_read_lock);
|
||||
}
|
||||
|
||||
static const struct seq_operations adf_ring_sops = {
|
||||
static const struct seq_operations adf_ring_debug_sops = {
|
||||
.start = adf_ring_start,
|
||||
.next = adf_ring_next,
|
||||
.stop = adf_ring_stop,
|
||||
.show = adf_ring_show
|
||||
};
|
||||
|
||||
static int adf_ring_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int ret = seq_open(file, &adf_ring_sops);
|
||||
|
||||
if (!ret) {
|
||||
struct seq_file *seq_f = file->private_data;
|
||||
|
||||
seq_f->private = inode->i_private;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations adf_ring_debug_fops = {
|
||||
.open = adf_ring_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release
|
||||
};
|
||||
DEFINE_SEQ_ATTRIBUTE(adf_ring_debug);
|
||||
|
||||
int adf_ring_debugfs_add(struct adf_etr_ring_data *ring, const char *name)
|
||||
{
|
||||
|
@ -188,31 +171,14 @@ static void adf_bank_stop(struct seq_file *sfile, void *v)
|
|||
mutex_unlock(&bank_read_lock);
|
||||
}
|
||||
|
||||
static const struct seq_operations adf_bank_sops = {
|
||||
static const struct seq_operations adf_bank_debug_sops = {
|
||||
.start = adf_bank_start,
|
||||
.next = adf_bank_next,
|
||||
.stop = adf_bank_stop,
|
||||
.show = adf_bank_show
|
||||
};
|
||||
|
||||
static int adf_bank_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int ret = seq_open(file, &adf_bank_sops);
|
||||
|
||||
if (!ret) {
|
||||
struct seq_file *seq_f = file->private_data;
|
||||
|
||||
seq_f->private = inode->i_private;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct file_operations adf_bank_debug_fops = {
|
||||
.open = adf_bank_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release
|
||||
};
|
||||
DEFINE_SEQ_ATTRIBUTE(adf_bank_debug);
|
||||
|
||||
int adf_bank_debugfs_add(struct adf_etr_bank_data *bank)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue