Skip to contentSkip to conversation

firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro

PATCH In review Yangtao Li 3 participants 3 messages Nov 22, 2018 – Dec 9, 2018 Texas instruments' system control interface (TISCI) protocol driver

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 firmware: ti_sci: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
 drivers/firmware/ti_sci.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)
drivers/firmware/ti_sci.c +2 -19
index 69ed1464175c..3fbbb61012c4 100644
@@ -146,25 +146,8 @@ static int ti_sci_debug_show(struct seq_file *s, void *unused)
 	return 0;
 }
 
-/**
- * ti_sci_debug_open() - debug file open
- * @inode:	inode pointer
- * @file:	file pointer
- *
- * Return: result of single_open
- */
-static int ti_sci_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, ti_sci_debug_show, inode->i_private);
-}
-
-/* log file operations */
-static const struct file_operations ti_sci_debug_fops = {
-	.open = ti_sci_debug_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = single_release,
-};
+/* Provide the log file operations interface*/
+DEFINE_SHOW_ATTRIBUTE(ti_sci_debug);
 
 /**
  * ti_sci_debugfs_create() - Create log debug file
Signature · 1 line
2.17.0