misc: remove GENWQE_DEBUGFS_RO()

We already have the DEFINE_SHOW_ATTRIBUTE.There is no need to define
such a macro,so remove GENWQE_DEBUGFS_RO.Also use DEFINE_SHOW_ATTRIBUTE
to simplify some code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yangtao Li
2018-12-01 12:05:30 -05:00
committed by Greg Kroah-Hartman
parent ddfa728ad1
commit 2796b43fee
8 changed files with 73 additions and 268 deletions

View File

@@ -37,9 +37,9 @@
static struct dentry *mic_dbg;
/**
* mic_intr_test - Send interrupts to host.
* mic_intr_show - Send interrupts to host.
*/
static int mic_intr_test(struct seq_file *s, void *unused)
static int mic_intr_show(struct seq_file *s, void *unused)
{
struct mic_driver *mdrv = s->private;
struct mic_device *mdev = &mdrv->mdev;
@@ -56,23 +56,7 @@ static int mic_intr_test(struct seq_file *s, void *unused)
return 0;
}
static int mic_intr_test_open(struct inode *inode, struct file *file)
{
return single_open(file, mic_intr_test, inode->i_private);
}
static int mic_intr_test_release(struct inode *inode, struct file *file)
{
return single_release(inode, file);
}
static const struct file_operations intr_test_ops = {
.owner = THIS_MODULE,
.open = mic_intr_test_open,
.read = seq_read,
.llseek = seq_lseek,
.release = mic_intr_test_release
};
DEFINE_SHOW_ATTRIBUTE(mic_intr);
/**
* mic_create_card_debug_dir - Initialize MIC debugfs entries.
@@ -91,7 +75,7 @@ void __init mic_create_card_debug_dir(struct mic_driver *mdrv)
}
d = debugfs_create_file("intr_test", 0444, mdrv->dbg_dir,
mdrv, &intr_test_ops);
mdrv, &mic_intr_fops);
if (!d) {
dev_err(mdrv->dev,