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

dmaengine: mic_x100_dma: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

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

authored by

Yangtao Li and committed by
Vinod Koul
0f7ab39a 8e1897bc

+3 -19
+3 -19
drivers/dma/mic_x100_dma.c
··· 676 676 } 677 677 678 678 /* DEBUGFS CODE */ 679 - static int mic_dma_reg_seq_show(struct seq_file *s, void *pos) 679 + static int mic_dma_reg_show(struct seq_file *s, void *pos) 680 680 { 681 681 struct mic_dma_device *mic_dma_dev = s->private; 682 682 int i, chan_num, first_chan = mic_dma_dev->start_ch; ··· 707 707 return 0; 708 708 } 709 709 710 - static int mic_dma_reg_debug_open(struct inode *inode, struct file *file) 711 - { 712 - return single_open(file, mic_dma_reg_seq_show, inode->i_private); 713 - } 714 - 715 - static int mic_dma_reg_debug_release(struct inode *inode, struct file *file) 716 - { 717 - return single_release(inode, file); 718 - } 719 - 720 - static const struct file_operations mic_dma_reg_ops = { 721 - .owner = THIS_MODULE, 722 - .open = mic_dma_reg_debug_open, 723 - .read = seq_read, 724 - .llseek = seq_lseek, 725 - .release = mic_dma_reg_debug_release 726 - }; 710 + DEFINE_SHOW_ATTRIBUTE(mic_dma_reg); 727 711 728 712 /* Debugfs parent dir */ 729 713 static struct dentry *mic_dma_dbg; ··· 731 747 if (mic_dma_dev->dbg_dir) 732 748 debugfs_create_file("mic_dma_reg", 0444, 733 749 mic_dma_dev->dbg_dir, mic_dma_dev, 734 - &mic_dma_reg_ops); 750 + &mic_dma_reg_fops); 735 751 } 736 752 return 0; 737 753 }