From: Liu Shixin Date: Wed, 16 Sep 2020 02:50:24 +0000 (+0200) Subject: media: saa7164: convert to use DEFINE_SEQ_ATTRIBUTE macro X-Git-Tag: accepted/tizen/unified/20230118.172025~8355^2~398 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1671d4ea7794495ad52599932f8821e81530dace;p=platform%2Fkernel%2Flinux-rpi.git media: saa7164: convert to use DEFINE_SEQ_ATTRIBUTE macro Use DEFINE_SEQ_ATTRIBUTE macro to simplify the code. Signed-off-by: Liu Shixin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index 6c08b77..f3a4e57 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1139,32 +1139,21 @@ static int saa7164_seq_show(struct seq_file *m, void *v) return 0; } -static const struct seq_operations saa7164_seq_ops = { +static const struct seq_operations saa7164_sops = { .start = saa7164_seq_start, .next = saa7164_seq_next, .stop = saa7164_seq_stop, .show = saa7164_seq_show, }; -static int saa7164_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &saa7164_seq_ops); -} - -static const struct file_operations saa7164_operations = { - .owner = THIS_MODULE, - .open = saa7164_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; +DEFINE_SEQ_ATTRIBUTE(saa7164); static struct dentry *saa7614_dentry; static void __init saa7164_debugfs_create(void) { saa7614_dentry = debugfs_create_file("saa7164", 0444, NULL, NULL, - &saa7164_operations); + &saa7164_fops); } static void __exit saa7164_debugfs_remove(void)