linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro
@ 2018-11-05 15:01 Yangtao Li
  2018-11-06  0:07 ` David Gibson
  2018-11-27  9:22 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Yangtao Li @ 2018-11-05 15:01 UTC (permalink / raw)
  To: benh, paulus, mpe, hbathini, mahesh, david, msuchanek
  Cc: Yangtao Li, linuxppc-dev, linux-kernel

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 arch/powerpc/kernel/fadump.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index a711d22339ea..2df5e04b5afc 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1531,17 +1531,7 @@ static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered,
 						0644, fadump_register_show,
 						fadump_register_store);
 
-static int fadump_region_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, fadump_region_show, inode->i_private);
-}
-
-static const struct file_operations fadump_region_fops = {
-	.open    = fadump_region_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(fadump_region);
 
 static void fadump_init_files(void)
 {
-- 
2.17.0


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

end of thread, other threads:[~2018-11-27  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05 15:01 [PATCH] powerpc/fadump: Change to use DEFINE_SHOW_ATTRIBUTE macro Yangtao Li
2018-11-06  0:07 ` David Gibson
2018-11-27  9:22 ` Michael Ellerman

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).