linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] media: exynos4-is: convert to DEFINE_SHOW_ATTRIBUTE
@ 2018-12-12 16:20 Yangtao Li
  2018-12-26 16:13 ` Frank Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2018-12-12 16:20 UTC (permalink / raw)
  To: kyungmin.park, s.nawrocki, mchehab, kgene, krzk
  Cc: linux-media, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Yangtao Li

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/media/platform/exynos4-is/fimc-is.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c
index f5fc54de19da..02da0b06e56a 100644
--- a/drivers/media/platform/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/exynos4-is/fimc-is.c
@@ -738,7 +738,7 @@ int fimc_is_hw_initialize(struct fimc_is *is)
 	return 0;
 }
 
-static int fimc_is_log_show(struct seq_file *s, void *data)
+static int fimc_is_show(struct seq_file *s, void *data)
 {
 	struct fimc_is *is = s->private;
 	const u8 *buf = is->memory.vaddr + FIMC_IS_DEBUG_REGION_OFFSET;
@@ -752,17 +752,7 @@ static int fimc_is_log_show(struct seq_file *s, void *data)
 	return 0;
 }
 
-static int fimc_is_debugfs_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, fimc_is_log_show, inode->i_private);
-}
-
-static const struct file_operations fimc_is_debugfs_fops = {
-	.open		= fimc_is_debugfs_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(fimc_is);
 
 static void fimc_is_debugfs_remove(struct fimc_is *is)
 {
@@ -777,7 +767,7 @@ static int fimc_is_debugfs_create(struct fimc_is *is)
 	is->debugfs_entry = debugfs_create_dir("fimc_is", NULL);
 
 	dentry = debugfs_create_file("fw_log", S_IRUGO, is->debugfs_entry,
-				     is, &fimc_is_debugfs_fops);
+				     is, &fimc_is_fops);
 	if (!dentry)
 		fimc_is_debugfs_remove(is);
 
-- 
2.17.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] media: exynos4-is: convert to DEFINE_SHOW_ATTRIBUTE
  2018-12-12 16:20 [PATCH v3] media: exynos4-is: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
@ 2018-12-26 16:13 ` Frank Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Lee @ 2018-12-26 16:13 UTC (permalink / raw)
  To: Kyungmin Park, s.nawrocki, mchehab, kgene, krzk
  Cc: linux-media, Linux ARM, linux-samsung-soc, Linux Kernel Mailing List

ping...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-26 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-12 16:20 [PATCH v3] media: exynos4-is: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
2018-12-26 16:13 ` Frank Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).