diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 00:17:00 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:15 -0400 |
commit | cab29b99dfaa6065e3b576e54d7f6cfa60fa2faf (patch) | |
tree | 6a99d2958f1c57c99dc253696bd3b7d6f840f700 /drivers/scsi/wd7000.c | |
parent | ee127fec448bb066b549d516af5fe5a596b6ad6c (diff) |
wd7000: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/scsi/wd7000.c')
-rw-r--r-- | drivers/scsi/wd7000.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index d89a5dfd3ade..f9a6e4b0affe 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c | |||
@@ -1296,9 +1296,9 @@ static void wd7000_revision(Adapter * host) | |||
1296 | 1296 | ||
1297 | 1297 | ||
1298 | #undef SPRINTF | 1298 | #undef SPRINTF |
1299 | #define SPRINTF(args...) { if (pos < (buffer + length)) pos += sprintf (pos, ## args); } | 1299 | #define SPRINTF(args...) { seq_printf(m, ## args); } |
1300 | 1300 | ||
1301 | static int wd7000_set_info(char *buffer, int length, struct Scsi_Host *host) | 1301 | static int wd7000_set_info(struct Scsi_Host *host, char *buffer, int length) |
1302 | { | 1302 | { |
1303 | dprintk("Buffer = <%.*s>, length = %d\n", length, buffer, length); | 1303 | dprintk("Buffer = <%.*s>, length = %d\n", length, buffer, length); |
1304 | 1304 | ||
@@ -1310,22 +1310,15 @@ static int wd7000_set_info(char *buffer, int length, struct Scsi_Host *host) | |||
1310 | } | 1310 | } |
1311 | 1311 | ||
1312 | 1312 | ||
1313 | static int wd7000_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int inout) | 1313 | static int wd7000_show_info(struct seq_file *m, struct Scsi_Host *host) |
1314 | { | 1314 | { |
1315 | Adapter *adapter = (Adapter *)host->hostdata; | 1315 | Adapter *adapter = (Adapter *)host->hostdata; |
1316 | unsigned long flags; | 1316 | unsigned long flags; |
1317 | char *pos = buffer; | ||
1318 | #ifdef WD7000_DEBUG | 1317 | #ifdef WD7000_DEBUG |
1319 | Mailbox *ogmbs, *icmbs; | 1318 | Mailbox *ogmbs, *icmbs; |
1320 | short count; | 1319 | short count; |
1321 | #endif | 1320 | #endif |
1322 | 1321 | ||
1323 | /* | ||
1324 | * Has data been written to the file ? | ||
1325 | */ | ||
1326 | if (inout) | ||
1327 | return (wd7000_set_info(buffer, length, host)); | ||
1328 | |||
1329 | spin_lock_irqsave(host->host_lock, flags); | 1322 | spin_lock_irqsave(host->host_lock, flags); |
1330 | SPRINTF("Host scsi%d: Western Digital WD-7000 (rev %d.%d)\n", host->host_no, adapter->rev1, adapter->rev2); | 1323 | SPRINTF("Host scsi%d: Western Digital WD-7000 (rev %d.%d)\n", host->host_no, adapter->rev1, adapter->rev2); |
1331 | SPRINTF(" IO base: 0x%x\n", adapter->iobase); | 1324 | SPRINTF(" IO base: 0x%x\n", adapter->iobase); |
@@ -1368,17 +1361,7 @@ static int wd7000_proc_info(struct Scsi_Host *host, char *buffer, char **start, | |||
1368 | 1361 | ||
1369 | spin_unlock_irqrestore(host->host_lock, flags); | 1362 | spin_unlock_irqrestore(host->host_lock, flags); |
1370 | 1363 | ||
1371 | /* | 1364 | return 0; |
1372 | * Calculate start of next buffer, and return value. | ||
1373 | */ | ||
1374 | *start = buffer + offset; | ||
1375 | |||
1376 | if ((pos - buffer) < offset) | ||
1377 | return (0); | ||
1378 | else if ((pos - buffer - offset) < length) | ||
1379 | return (pos - buffer - offset); | ||
1380 | else | ||
1381 | return (length); | ||
1382 | } | 1365 | } |
1383 | 1366 | ||
1384 | 1367 | ||
@@ -1413,7 +1396,8 @@ static __init int wd7000_detect(struct scsi_host_template *tpnt) | |||
1413 | for (i = 0; i < NUM_CONFIGS; biosptr[i++] = -1); | 1396 | for (i = 0; i < NUM_CONFIGS; biosptr[i++] = -1); |
1414 | 1397 | ||
1415 | tpnt->proc_name = "wd7000"; | 1398 | tpnt->proc_name = "wd7000"; |
1416 | tpnt->proc_info = &wd7000_proc_info; | 1399 | tpnt->show_info = &wd7000_show_info; |
1400 | tpnt->write_info = wd7000_set_info; | ||
1417 | 1401 | ||
1418 | /* | 1402 | /* |
1419 | * Set up SCB free list, which is shared by all adapters | 1403 | * Set up SCB free list, which is shared by all adapters |
@@ -1658,7 +1642,8 @@ MODULE_LICENSE("GPL"); | |||
1658 | 1642 | ||
1659 | static struct scsi_host_template driver_template = { | 1643 | static struct scsi_host_template driver_template = { |
1660 | .proc_name = "wd7000", | 1644 | .proc_name = "wd7000", |
1661 | .proc_info = wd7000_proc_info, | 1645 | .show_info = wd7000_show_info, |
1646 | .write_info = wd7000_set_info, | ||
1662 | .name = "Western Digital WD-7000", | 1647 | .name = "Western Digital WD-7000", |
1663 | .detect = wd7000_detect, | 1648 | .detect = wd7000_detect, |
1664 | .release = wd7000_release, | 1649 | .release = wd7000_release, |