Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: qcom_hidma: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Sinan Kaya <okaya@kernel.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Yangtao Li and committed by
Vinod Koul
f7f41722 e00f50a7

+6 -27
+6 -27
drivers/dma/qcom/hidma_dbg.c
··· 85 85 } 86 86 87 87 /* 88 - * hidma_chan_stats: display HIDMA channel statistics 88 + * hidma_chan_show: display HIDMA channel statistics 89 89 * 90 90 * Display the statistics for the current HIDMA virtual channel device. 91 91 */ 92 - static int hidma_chan_stats(struct seq_file *s, void *unused) 92 + static int hidma_chan_show(struct seq_file *s, void *unused) 93 93 { 94 94 struct hidma_chan *mchan = s->private; 95 95 struct hidma_desc *mdesc; ··· 117 117 } 118 118 119 119 /* 120 - * hidma_dma_info: display HIDMA device info 120 + * hidma_dma_show: display HIDMA device info 121 121 * 122 122 * Display the info for the current HIDMA device. 123 123 */ 124 - static int hidma_dma_info(struct seq_file *s, void *unused) 124 + static int hidma_dma_show(struct seq_file *s, void *unused) 125 125 { 126 126 struct hidma_dev *dmadev = s->private; 127 127 resource_size_t sz; ··· 138 138 return 0; 139 139 } 140 140 141 - static int hidma_chan_stats_open(struct inode *inode, struct file *file) 142 - { 143 - return single_open(file, hidma_chan_stats, inode->i_private); 144 - } 145 - 146 - static int hidma_dma_info_open(struct inode *inode, struct file *file) 147 - { 148 - return single_open(file, hidma_dma_info, inode->i_private); 149 - } 150 - 151 - static const struct file_operations hidma_chan_fops = { 152 - .open = hidma_chan_stats_open, 153 - .read = seq_read, 154 - .llseek = seq_lseek, 155 - .release = single_release, 156 - }; 157 - 158 - static const struct file_operations hidma_dma_fops = { 159 - .open = hidma_dma_info_open, 160 - .read = seq_read, 161 - .llseek = seq_lseek, 162 - .release = single_release, 163 - }; 141 + DEFINE_SHOW_ATTRIBUTE(hidma_chan); 142 + DEFINE_SHOW_ATTRIBUTE(hidma_dma); 164 143 165 144 void hidma_debug_uninit(struct hidma_dev *dmadev) 166 145 {