mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:41:02 +07:00
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>
This commit is contained in:
parent
8e1897bc8e
commit
0f7ab39a6b
@ -676,7 +676,7 @@ static void mic_dma_dev_unreg(struct mic_dma_device *mic_dma_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* DEBUGFS CODE */
|
/* DEBUGFS CODE */
|
||||||
static int mic_dma_reg_seq_show(struct seq_file *s, void *pos)
|
static int mic_dma_reg_show(struct seq_file *s, void *pos)
|
||||||
{
|
{
|
||||||
struct mic_dma_device *mic_dma_dev = s->private;
|
struct mic_dma_device *mic_dma_dev = s->private;
|
||||||
int i, chan_num, first_chan = mic_dma_dev->start_ch;
|
int i, chan_num, first_chan = mic_dma_dev->start_ch;
|
||||||
@ -707,23 +707,7 @@ static int mic_dma_reg_seq_show(struct seq_file *s, void *pos)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mic_dma_reg_debug_open(struct inode *inode, struct file *file)
|
DEFINE_SHOW_ATTRIBUTE(mic_dma_reg);
|
||||||
{
|
|
||||||
return single_open(file, mic_dma_reg_seq_show, inode->i_private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int mic_dma_reg_debug_release(struct inode *inode, struct file *file)
|
|
||||||
{
|
|
||||||
return single_release(inode, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct file_operations mic_dma_reg_ops = {
|
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.open = mic_dma_reg_debug_open,
|
|
||||||
.read = seq_read,
|
|
||||||
.llseek = seq_lseek,
|
|
||||||
.release = mic_dma_reg_debug_release
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Debugfs parent dir */
|
/* Debugfs parent dir */
|
||||||
static struct dentry *mic_dma_dbg;
|
static struct dentry *mic_dma_dbg;
|
||||||
@ -747,7 +731,7 @@ static int mic_dma_driver_probe(struct mbus_device *mbdev)
|
|||||||
if (mic_dma_dev->dbg_dir)
|
if (mic_dma_dev->dbg_dir)
|
||||||
debugfs_create_file("mic_dma_reg", 0444,
|
debugfs_create_file("mic_dma_reg", 0444,
|
||||||
mic_dma_dev->dbg_dir, mic_dma_dev,
|
mic_dma_dev->dbg_dir, mic_dma_dev,
|
||||||
&mic_dma_reg_ops);
|
&mic_dma_reg_fops);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user