diff options
-rw-r--r-- | drivers/scsi/nsp32.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index 1cc0c1c69c88..1e3879dcbdcc 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c | |||
@@ -192,7 +192,7 @@ static int __init init_nsp32 (void); | |||
192 | static void __exit exit_nsp32 (void); | 192 | static void __exit exit_nsp32 (void); |
193 | 193 | ||
194 | /* struct struct scsi_host_template */ | 194 | /* struct struct scsi_host_template */ |
195 | static int nsp32_proc_info (struct Scsi_Host *, char *, char **, off_t, int, int); | 195 | static int nsp32_show_info (struct seq_file *, struct Scsi_Host *); |
196 | 196 | ||
197 | static int nsp32_detect (struct pci_dev *pdev); | 197 | static int nsp32_detect (struct pci_dev *pdev); |
198 | static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); | 198 | static int nsp32_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); |
@@ -268,7 +268,7 @@ static void nsp32_dmessage(const char *, int, int, char *, ...); | |||
268 | static struct scsi_host_template nsp32_template = { | 268 | static struct scsi_host_template nsp32_template = { |
269 | .proc_name = "nsp32", | 269 | .proc_name = "nsp32", |
270 | .name = "Workbit NinjaSCSI-32Bi/UDE", | 270 | .name = "Workbit NinjaSCSI-32Bi/UDE", |
271 | .proc_info = nsp32_proc_info, | 271 | .show_info = nsp32_show_info, |
272 | .info = nsp32_info, | 272 | .info = nsp32_info, |
273 | .queuecommand = nsp32_queuecommand, | 273 | .queuecommand = nsp32_queuecommand, |
274 | .can_queue = 1, | 274 | .can_queue = 1, |
@@ -1442,19 +1442,10 @@ static irqreturn_t do_nsp32_isr(int irq, void *dev_id) | |||
1442 | } | 1442 | } |
1443 | 1443 | ||
1444 | #undef SPRINTF | 1444 | #undef SPRINTF |
1445 | #define SPRINTF(args...) \ | 1445 | #define SPRINTF(args...) seq_printf(m, ##args) |
1446 | do { \ | 1446 | |
1447 | if(length > (pos - buffer)) { \ | 1447 | static int nsp32_show_info(struct seq_file *m, struct Scsi_Host *host) |
1448 | pos += snprintf(pos, length - (pos - buffer) + 1, ## args); \ | ||
1449 | nsp32_dbg(NSP32_DEBUG_PROC, "buffer=0x%p pos=0x%p length=%d %d\n", buffer, pos, length, length - (pos - buffer));\ | ||
1450 | } \ | ||
1451 | } while(0) | ||
1452 | |||
1453 | static int nsp32_proc_info(struct Scsi_Host *host, char *buffer, char **start, | ||
1454 | off_t offset, int length, int inout) | ||
1455 | { | 1448 | { |
1456 | char *pos = buffer; | ||
1457 | int thislength; | ||
1458 | unsigned long flags; | 1449 | unsigned long flags; |
1459 | nsp32_hw_data *data; | 1450 | nsp32_hw_data *data; |
1460 | int hostno; | 1451 | int hostno; |
@@ -1463,11 +1454,6 @@ static int nsp32_proc_info(struct Scsi_Host *host, char *buffer, char **start, | |||
1463 | int id, speed; | 1454 | int id, speed; |
1464 | long model; | 1455 | long model; |
1465 | 1456 | ||
1466 | /* Write is not supported, just return. */ | ||
1467 | if (inout == TRUE) { | ||
1468 | return -EINVAL; | ||
1469 | } | ||
1470 | |||
1471 | hostno = host->host_no; | 1457 | hostno = host->host_no; |
1472 | data = (nsp32_hw_data *)host->hostdata; | 1458 | data = (nsp32_hw_data *)host->hostdata; |
1473 | base = host->io_port; | 1459 | base = host->io_port; |
@@ -1527,20 +1513,7 @@ static int nsp32_proc_info(struct Scsi_Host *host, char *buffer, char **start, | |||
1527 | } | 1513 | } |
1528 | SPRINTF("\n"); | 1514 | SPRINTF("\n"); |
1529 | } | 1515 | } |
1530 | 1516 | return 0; | |
1531 | |||
1532 | thislength = pos - (buffer + offset); | ||
1533 | |||
1534 | if(thislength < 0) { | ||
1535 | *start = NULL; | ||
1536 | return 0; | ||
1537 | } | ||
1538 | |||
1539 | |||
1540 | thislength = min(thislength, length); | ||
1541 | *start = buffer + offset; | ||
1542 | |||
1543 | return thislength; | ||
1544 | } | 1517 | } |
1545 | #undef SPRINTF | 1518 | #undef SPRINTF |
1546 | 1519 | ||