crypto: hisilicon/qm - Convert to DEFINE_SHOW_ATTRIBUTE
authorQinglang Miao <miaoqinglang@huawei.com>
Fri, 18 Sep 2020 01:31:13 +0000 (09:31 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 25 Sep 2020 07:48:16 +0000 (17:48 +1000)
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/qm.c

index 07efc52..1923f15 100644 (file)
@@ -1050,17 +1050,7 @@ static int qm_regs_show(struct seq_file *s, void *unused)
        return 0;
 }
 
-static int qm_regs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, qm_regs_show, inode->i_private);
-}
-
-static const struct file_operations qm_regs_fops = {
-       .owner = THIS_MODULE,
-       .open = qm_regs_open,
-       .read = seq_read,
-       .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(qm_regs);
 
 static ssize_t qm_cmd_read(struct file *filp, char __user *buffer,
                           size_t count, loff_t *pos)