Commit 74e0e43a authored by Qinglang Miao's avatar Qinglang Miao Committed by Santosh Shilimkar

soc: ti: Convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarQinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
parent 6259c844
...@@ -355,7 +355,7 @@ static void dma_debug_show_devices(struct seq_file *s, ...@@ -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; struct knav_dma_device *dma;
...@@ -370,17 +370,7 @@ static int dma_debug_show(struct seq_file *s, void *v) ...@@ -370,17 +370,7 @@ static int dma_debug_show(struct seq_file *s, void *v)
return 0; return 0;
} }
static int knav_dma_debug_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(knav_dma_debug);
{
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,
};
static int of_channel_match_helper(struct device_node *np, const char *name, static int of_channel_match_helper(struct device_node *np, const char *name,
const char **dma_instance) const char **dma_instance)
...@@ -778,7 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev) ...@@ -778,7 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev)
} }
debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL, debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
&knav_dma_debug_ops); &knav_dma_debug_fops);
device_ready = true; device_ready = true;
return ret; return ret;
......
...@@ -478,17 +478,7 @@ static int knav_queue_debug_show(struct seq_file *s, void *v) ...@@ -478,17 +478,7 @@ static int knav_queue_debug_show(struct seq_file *s, void *v)
return 0; return 0;
} }
static int knav_queue_debug_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(knav_queue_debug);
{
return single_open(file, knav_queue_debug_show, NULL);
}
static const struct file_operations knav_queue_debug_ops = {
.open = knav_queue_debug_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static inline int knav_queue_pdsp_wait(u32 * __iomem addr, unsigned timeout, static inline int knav_queue_pdsp_wait(u32 * __iomem addr, unsigned timeout,
u32 flags) u32 flags)
...@@ -1878,7 +1868,7 @@ static int knav_queue_probe(struct platform_device *pdev) ...@@ -1878,7 +1868,7 @@ static int knav_queue_probe(struct platform_device *pdev)
} }
debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL, debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
&knav_queue_debug_ops); &knav_queue_debug_fops);
device_ready = true; device_ready = true;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment