Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE
@ 2018-12-02  4:14 ` Yangtao Li
  2018-12-02  4:16   ` Frank Lee
  2018-12-20 17:53   ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2018-12-02  4:14 UTC (permalink / raw)
  To: b.zolnierkie, fengguang.wu, mchehab+samsung
  Cc: linux-omap, linux-fbdev, dri-devel, linux-kernel, Yangtao Li

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/core.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/core.c b/drivers/video/fbdev/omap2/omapfb/dss/core.c
index a5e58a829ea0..b4bcf3a4a647 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c
@@ -99,24 +99,14 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput)
 }
 
 #if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS)
-static int dss_debug_show(struct seq_file *s, void *unused)
+static int dss_show(struct seq_file *s, void *unused)
 {
 	void (*func)(struct seq_file *) = s->private;
 	func(s);
 	return 0;
 }
 
-static int dss_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, dss_debug_show, inode->i_private);
-}
-
-static const struct file_operations dss_debug_fops = {
-	.open           = dss_debug_open,
-	.read           = seq_read,
-	.llseek         = seq_lseek,
-	.release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(dss);
 
 static struct dentry *dss_debugfs_dir;
 
@@ -130,7 +120,7 @@ static int dss_initialize_debugfs(void)
 	}
 
 	debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
-			&dss_debug_dump_clocks, &dss_debug_fops);
+			&dss_debug_dump_clocks, &dss_fops);
 
 	return 0;
 }
@@ -145,7 +135,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
 	struct dentry *d;
 
 	d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
-			write, &dss_debug_fops);
+			write, &dss_fops);
 
 	return PTR_ERR_OR_ZERO(d);
 }
-- 
2.17.0

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

* Re: [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE
  2018-12-02  4:14 ` [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
@ 2018-12-02  4:16   ` Frank Lee
  2018-12-20 17:53   ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Lee @ 2018-12-02  4:16 UTC (permalink / raw)
  To: b.zolnierkie, fengguang.wu, mchehab+samsung
  Cc: linux-omap, linux-fbdev, dri-devel, linux-kernel

On Sun, Dec 2, 2018 at 12:14 PM Yangtao Li <tiny.windzz@gmail.com> wrote:
>
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
Changes in v2:
-Add a missing edit of dss_fops
---

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

* Re: [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE
  2018-12-02  4:14 ` [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
  2018-12-02  4:16   ` Frank Lee
@ 2018-12-20 17:53   ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-12-20 17:53 UTC (permalink / raw)
  To: Yangtao Li
  Cc: fengguang.wu, mchehab+samsung, linux-omap, linux-fbdev, dri-devel,
	linux-kernel


On 12/02/2018 05:14 AM, Yangtao Li wrote:
> Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Patch queued for 4.21, thanks.

[ subject line was fixed to "fbdev" from "media" while applying ]

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

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

end of thread, other threads:[~2018-12-20 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20181202041516epcas2p15e1891900f58e7da0a4a18148ffa8060@epcas2p1.samsung.com>
2018-12-02  4:14 ` [PATCH v2] media: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE Yangtao Li
2018-12-02  4:16   ` Frank Lee
2018-12-20 17:53   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox