aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 02:14:18 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:21 -0400
commit63fd57cb5c21b7b914b13be0b225829c0f5dba10 (patch)
treef304ffa1cab1294dedbcef32d876483524ccd342
parent35c6e0e512910a246e9063a2ddce85741747f0d7 (diff)
nsp_cs: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c36
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h9
2 files changed, 7 insertions, 38 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index b61a753eb896..987fbb1b244e 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -76,7 +76,7 @@ MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0
76 76
77static struct scsi_host_template nsp_driver_template = { 77static struct scsi_host_template nsp_driver_template = {
78 .proc_name = "nsp_cs", 78 .proc_name = "nsp_cs",
79 .proc_info = nsp_proc_info, 79 .show_info = nsp_show_info,
80 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", 80 .name = "WorkBit NinjaSCSI-3/32Bi(16bit)",
81 .info = nsp_info, 81 .info = nsp_info,
82 .queuecommand = nsp_queuecommand, 82 .queuecommand = nsp_queuecommand,
@@ -1365,33 +1365,19 @@ static const char *nsp_info(struct Scsi_Host *shpnt)
1365} 1365}
1366 1366
1367#undef SPRINTF 1367#undef SPRINTF
1368#define SPRINTF(args...) \ 1368#define SPRINTF(args...) seq_printf(m, ##args)
1369 do { \ 1369
1370 if(length > (pos - buffer)) { \ 1370static int nsp_show_info(struct seq_file *m, struct Scsi_Host *host)
1371 pos += snprintf(pos, length - (pos - buffer) + 1, ## args); \
1372 nsp_dbg(NSP_DEBUG_PROC, "buffer=0x%p pos=0x%p length=%d %d\n", buffer, pos, length, length - (pos - buffer));\
1373 } \
1374 } while(0)
1375
1376static int nsp_proc_info(struct Scsi_Host *host, char *buffer, char **start,
1377 off_t offset, int length, int inout)
1378{ 1371{
1379 int id; 1372 int id;
1380 char *pos = buffer;
1381 int thislength;
1382 int speed; 1373 int speed;
1383 unsigned long flags; 1374 unsigned long flags;
1384 nsp_hw_data *data; 1375 nsp_hw_data *data;
1385 int hostno; 1376 int hostno;
1386 1377
1387 if (inout) {
1388 return -EINVAL;
1389 }
1390
1391 hostno = host->host_no; 1378 hostno = host->host_no;
1392 data = (nsp_hw_data *)host->hostdata; 1379 data = (nsp_hw_data *)host->hostdata;
1393 1380
1394
1395 SPRINTF("NinjaSCSI status\n\n"); 1381 SPRINTF("NinjaSCSI status\n\n");
1396 SPRINTF("Driver version: $Revision: 1.23 $\n"); 1382 SPRINTF("Driver version: $Revision: 1.23 $\n");
1397 SPRINTF("SCSI host No.: %d\n", hostno); 1383 SPRINTF("SCSI host No.: %d\n", hostno);
@@ -1458,19 +1444,7 @@ static int nsp_proc_info(struct Scsi_Host *host, char *buffer, char **start,
1458 } 1444 }
1459 SPRINTF("\n"); 1445 SPRINTF("\n");
1460 } 1446 }
1461 1447 return 0;
1462 thislength = pos - (buffer + offset);
1463
1464 if(thislength < 0) {
1465 *start = NULL;
1466 return 0;
1467 }
1468
1469
1470 thislength = min(thislength, length);
1471 *start = buffer + offset;
1472
1473 return thislength;
1474} 1448}
1475#undef SPRINTF 1449#undef SPRINTF
1476 1450
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 7fc9a9d0a448..afd64f0adc4b 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -292,13 +292,8 @@ static int nsp_cs_config (struct pcmcia_device *link);
292/* Linux SCSI subsystem specific functions */ 292/* Linux SCSI subsystem specific functions */
293static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); 293static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht);
294static const char *nsp_info (struct Scsi_Host *shpnt); 294static const char *nsp_info (struct Scsi_Host *shpnt);
295static int nsp_proc_info ( 295static int nsp_show_info (struct seq_file *m,
296 struct Scsi_Host *host, 296 struct Scsi_Host *host);
297 char *buffer,
298 char **start,
299 off_t offset,
300 int length,
301 int inout);
302static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); 297static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt);
303 298
304/* Error handler */ 299/* Error handler */