Commit ca92b93d authored by Yangtao Li's avatar Yangtao Li Committed by Martin Schwidefsky

s390: 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 avatarSebastian Ott <sebott@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 5b39fc04
...@@ -1192,20 +1192,7 @@ static int dasd_hosts_show(struct seq_file *m, void *v) ...@@ -1192,20 +1192,7 @@ static int dasd_hosts_show(struct seq_file *m, void *v)
return rc; return rc;
} }
static int dasd_hosts_open(struct inode *inode, struct file *file) DEFINE_SHOW_ATTRIBUTE(dasd_hosts);
{
struct dasd_device *device = inode->i_private;
return single_open(file, dasd_hosts_show, device);
}
static const struct file_operations dasd_hosts_fops = {
.owner = THIS_MODULE,
.open = dasd_hosts_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static void dasd_hosts_exit(struct dasd_device *device) static void dasd_hosts_exit(struct dasd_device *device)
{ {
......
...@@ -190,19 +190,7 @@ static int qstat_show(struct seq_file *m, void *v) ...@@ -190,19 +190,7 @@ static int qstat_show(struct seq_file *m, void *v)
return 0; return 0;
} }
static int qstat_seq_open(struct inode *inode, struct file *filp) DEFINE_SHOW_ATTRIBUTE(qstat);
{
return single_open(filp, qstat_show,
file_inode(filp)->i_private);
}
static const struct file_operations debugfs_fops = {
.owner = THIS_MODULE,
.open = qstat_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static char *qperf_names[] = { static char *qperf_names[] = {
"Assumed adapter interrupts", "Assumed adapter interrupts",
...@@ -306,7 +294,7 @@ static void setup_debugfs_entry(struct qdio_q *q) ...@@ -306,7 +294,7 @@ static void setup_debugfs_entry(struct qdio_q *q)
q->is_input_q ? "input" : "output", q->is_input_q ? "input" : "output",
q->nr); q->nr);
q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR,
q->irq_ptr->debugfs_dev, q, &debugfs_fops); q->irq_ptr->debugfs_dev, q, &qstat_fops);
if (IS_ERR(q->debugfs_q)) if (IS_ERR(q->debugfs_q))
q->debugfs_q = NULL; q->debugfs_q = NULL;
} }
......
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