Skip to contentSkip to conversation

soc: ti: Change to use DEFINE_SHOW_ATTRIBUTE macro

PATCH New Yangtao Li 1 participant 1 message Nov 22, 2018 TI Keystone multicore navigator drivers

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 soc: ti: Change to use DEFINE_SHOW_ATTRIBUTE macro

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

---
 drivers/soc/ti/knav_dma.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/soc/ti/knav_dma.c +3 -13
index e05ab16d9a9e..2a66f36b9fd6 100644
@@ -355,7 +355,7 @@ static void dma_debug_show_devices(struct seq_file *s,
 	}
 }
 
-static int dma_debug_show(struct seq_file *s, void *v)
+static int knav_dma_debug_show(struct seq_file *s, void *v)
 {
 	struct knav_dma_device *dma;
 
@@ -370,17 +370,7 @@ static int dma_debug_show(struct seq_file *s, void *v)
 	return 0;
 }
 
-static int knav_dma_debug_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, dma_debug_show, NULL);
-}
-
-static const struct file_operations knav_dma_debug_ops = {
-	.open		= knav_dma_debug_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(knav_dma_debug);
 
 static int of_channel_match_helper(struct device_node *np, const char *name,
 					const char **dma_instance)
@@ -778,7 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev)
 	}
 
 	debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
-			    &knav_dma_debug_ops);
+			    &knav_dma_debug_fops);
 
 	device_ready = true;
 	return ret;
Signature · 1 line
2.17.0