Skip to content

Commit ca92b93

Browse files
TinyWindzzMartin Schwidefsky
authored andcommitted
s390: 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: Sebastian Ott <sebott@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 5b39fc0 commit ca92b93

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

drivers/s390/block/dasd.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,20 +1192,7 @@ static int dasd_hosts_show(struct seq_file *m, void *v)
11921192
return rc;
11931193
}
11941194

1195-
static int dasd_hosts_open(struct inode *inode, struct file *file)
1196-
{
1197-
struct dasd_device *device = inode->i_private;
1198-
1199-
return single_open(file, dasd_hosts_show, device);
1200-
}
1201-
1202-
static const struct file_operations dasd_hosts_fops = {
1203-
.owner = THIS_MODULE,
1204-
.open = dasd_hosts_open,
1205-
.read = seq_read,
1206-
.llseek = seq_lseek,
1207-
.release = single_release,
1208-
};
1195+
DEFINE_SHOW_ATTRIBUTE(dasd_hosts);
12091196

12101197
static void dasd_hosts_exit(struct dasd_device *device)
12111198
{

drivers/s390/cio/qdio_debug.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,7 @@ static int qstat_show(struct seq_file *m, void *v)
190190
return 0;
191191
}
192192

193-
static int qstat_seq_open(struct inode *inode, struct file *filp)
194-
{
195-
return single_open(filp, qstat_show,
196-
file_inode(filp)->i_private);
197-
}
198-
199-
static const struct file_operations debugfs_fops = {
200-
.owner = THIS_MODULE,
201-
.open = qstat_seq_open,
202-
.read = seq_read,
203-
.llseek = seq_lseek,
204-
.release = single_release,
205-
};
193+
DEFINE_SHOW_ATTRIBUTE(qstat);
206194

207195
static char *qperf_names[] = {
208196
"Assumed adapter interrupts",
@@ -306,7 +294,7 @@ static void setup_debugfs_entry(struct qdio_q *q)
306294
q->is_input_q ? "input" : "output",
307295
q->nr);
308296
q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR,
309-
q->irq_ptr->debugfs_dev, q, &debugfs_fops);
297+
q->irq_ptr->debugfs_dev, q, &qstat_fops);
310298
if (IS_ERR(q->debugfs_q))
311299
q->debugfs_q = NULL;
312300
}

0 commit comments

Comments
 (0)