Skip to content

Commit 74e0e43

Browse files
Qinglang MiaoSantoshShilimkar
authored andcommitted
soc: ti: Convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
1 parent 6259c84 commit 74e0e43

2 files changed

Lines changed: 5 additions & 25 deletions

File tree

drivers/soc/ti/knav_dma.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static void dma_debug_show_devices(struct seq_file *s,
355355
}
356356
}
357357

358-
static int dma_debug_show(struct seq_file *s, void *v)
358+
static int knav_dma_debug_show(struct seq_file *s, void *v)
359359
{
360360
struct knav_dma_device *dma;
361361

@@ -370,17 +370,7 @@ static int dma_debug_show(struct seq_file *s, void *v)
370370
return 0;
371371
}
372372

373-
static int knav_dma_debug_open(struct inode *inode, struct file *file)
374-
{
375-
return single_open(file, dma_debug_show, NULL);
376-
}
377-
378-
static const struct file_operations knav_dma_debug_ops = {
379-
.open = knav_dma_debug_open,
380-
.read = seq_read,
381-
.llseek = seq_lseek,
382-
.release = single_release,
383-
};
373+
DEFINE_SHOW_ATTRIBUTE(knav_dma_debug);
384374

385375
static int of_channel_match_helper(struct device_node *np, const char *name,
386376
const char **dma_instance)
@@ -778,7 +768,7 @@ static int knav_dma_probe(struct platform_device *pdev)
778768
}
779769

780770
debugfs_create_file("knav_dma", S_IFREG | S_IRUGO, NULL, NULL,
781-
&knav_dma_debug_ops);
771+
&knav_dma_debug_fops);
782772

783773
device_ready = true;
784774
return ret;

drivers/soc/ti/knav_qmss_queue.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -478,17 +478,7 @@ static int knav_queue_debug_show(struct seq_file *s, void *v)
478478
return 0;
479479
}
480480

481-
static int knav_queue_debug_open(struct inode *inode, struct file *file)
482-
{
483-
return single_open(file, knav_queue_debug_show, NULL);
484-
}
485-
486-
static const struct file_operations knav_queue_debug_ops = {
487-
.open = knav_queue_debug_open,
488-
.read = seq_read,
489-
.llseek = seq_lseek,
490-
.release = single_release,
491-
};
481+
DEFINE_SHOW_ATTRIBUTE(knav_queue_debug);
492482

493483
static inline int knav_queue_pdsp_wait(u32 * __iomem addr, unsigned timeout,
494484
u32 flags)
@@ -1878,7 +1868,7 @@ static int knav_queue_probe(struct platform_device *pdev)
18781868
}
18791869

18801870
debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
1881-
&knav_queue_debug_ops);
1871+
&knav_queue_debug_fops);
18821872
device_ready = true;
18831873
return 0;
18841874

0 commit comments

Comments
 (0)