Commit 8e1897bc authored by Yangtao Li's avatar Yangtao Li Committed by Vinod Koul

dmaengine: amba-pl08x: convert to DEFINE_SHOW_ATTRIBUTE

Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a5b21a8b
...@@ -2505,24 +2505,14 @@ static int pl08x_debugfs_show(struct seq_file *s, void *data) ...@@ -2505,24 +2505,14 @@ static int pl08x_debugfs_show(struct seq_file *s, void *data)
return 0; return 0;
} }
static int pl08x_debugfs_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(pl08x_debugfs);
{
return single_open(file, pl08x_debugfs_show, inode->i_private);
}
static const struct file_operations pl08x_debugfs_operations = {
.open = pl08x_debugfs_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void init_pl08x_debugfs(struct pl08x_driver_data *pl08x) static void init_pl08x_debugfs(struct pl08x_driver_data *pl08x)
{ {
/* Expose a simple debugfs interface to view all clocks */ /* Expose a simple debugfs interface to view all clocks */
(void) debugfs_create_file(dev_name(&pl08x->adev->dev), (void) debugfs_create_file(dev_name(&pl08x->adev->dev),
S_IFREG | S_IRUGO, NULL, pl08x, S_IFREG | S_IRUGO, NULL, pl08x,
&pl08x_debugfs_operations); &pl08x_debugfs_fops);
} }
#else #else
......
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