mfd: ab3100-core: Convert to DEFINE_SHOW_ATTRIBUTE
PATCH v2 1/1 mfd: ab3100-core: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by Qinglang Miao <[email protected]>
---
v2: based on linux-next(20200917), and can be applied to
mainline cleanly now.
drivers/mfd/ab3100-core.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/mfd/ab3100-core.c +2 -13
@@ -451,7 +451,7 @@ static irqreturn_t ab3100_irq_handler(int irq, void *data)/* * Some debugfs entries only exposed if we're using debug */ -static int ab3100_registers_print (struct seq_file *s,void *p) +static int ab3100_registers_show (struct seq_file *s,void *p) {struct ab3100 *ab3100 = s->private;u8 value;
@@ -466,18 +466,7 @@ static int ab3100_registers_print(struct seq_file *s, void *p)return 0 ; } -static int ab3100_registers_open (struct inode *inode,struct file *file) -{ -return single_open (file, ab3100_registers_print, inode->i_private); -} - -static const struct file_operations ab3100_registers_fops = { - .open = ab3100_registers_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner =THIS_MODULE , -}; +DEFINE_SHOW_ATTRIBUTE (ab3100_registers);struct ab3100_get_set_reg_priv {struct ab3100 *ab3100;
Signature · 1 line
2.23.0
Quoted 3 lines · Qinglang Miao
Use
DEFINE_SHOW_ATTRIBUTEmacro to simplify the code.Signed-off-by Qinglang Miao <[email protected]>
Reviewed-by Linus Walleij <[email protected]>
Yours,
Linus Walleij