summaryrefslogtreecommitdiff
path: root/drivers/misc/ti-st
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-01 12:05:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-06 15:42:18 +0100
commit2796b43feeeaf2d74998e42d1fddcefed6955f54 (patch)
treeb57cae66202a7b4506c2c1881046a56c92b3180c /drivers/misc/ti-st
parentddfa728ad1b1dbb4172ba65f3043d2d50c694f3d (diff)
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>
Diffstat (limited to 'drivers/misc/ti-st')
-rw-r--r--drivers/misc/ti-st/st_kim.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 1874ac922166..e47abf173626 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -564,7 +564,7 @@ long st_kim_stop(void *kim_data)
/* functions called from subsystems */
/* called when debugfs entry is read from */
-static int show_version(struct seq_file *s, void *unused)
+static int version_show(struct seq_file *s, void *unused)
{
struct kim_data_s *kim_gdata = (struct kim_data_s *)s->private;
seq_printf(s, "%04X %d.%d.%d\n", kim_gdata->version.full,
@@ -573,7 +573,7 @@ static int show_version(struct seq_file *s, void *unused)
return 0;
}
-static int show_list(struct seq_file *s, void *unused)
+static int list_show(struct seq_file *s, void *unused)
{
struct kim_data_s *kim_gdata = (struct kim_data_s *)s->private;
kim_st_list_protocols(kim_gdata->core_data, s);
@@ -688,30 +688,8 @@ err:
*core_data = NULL;
}
-static int kim_version_open(struct inode *i, struct file *f)
-{
- return single_open(f, show_version, i->i_private);
-}
-
-static int kim_list_open(struct inode *i, struct file *f)
-{
- return single_open(f, show_list, i->i_private);
-}
-
-static const struct file_operations version_debugfs_fops = {
- /* version info */
- .open = kim_version_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
-static const struct file_operations list_debugfs_fops = {
- /* protocols info */
- .open = kim_list_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(version);
+DEFINE_SHOW_ATTRIBUTE(list);
/**********************************************************************/
/* functions called from platform device driver subsystem
@@ -789,9 +767,9 @@ static int kim_probe(struct platform_device *pdev)
}
debugfs_create_file("version", S_IRUGO, kim_debugfs_dir,
- kim_gdata, &version_debugfs_fops);
+ kim_gdata, &version_fops);
debugfs_create_file("protocols", S_IRUGO, kim_debugfs_dir,
- kim_gdata, &list_debugfs_fops);
+ kim_gdata, &list_fops);
return 0;
err_sysfs_group: