diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 03:24:12 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:24 -0400 |
commit | d32812ae4b94a306e84cfbfbfeecda4ba3d1ba0f (patch) | |
tree | c24ac2a22a07bc4caa1c03f6d7908ebf2763dec9 /drivers/scsi/dc395x.c | |
parent | ff98f7ce0ec89a3de50a1920eb8a223bf0a3a6f2 (diff) |
dc395x: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/scsi/dc395x.c')
-rw-r--r-- | drivers/scsi/dc395x.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index fed486bfd3f4..694e13c45dfd 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -4616,26 +4616,21 @@ static void adapter_uninit(struct AdapterCtlBlk *acb) | |||
4616 | 4616 | ||
4617 | 4617 | ||
4618 | #undef SPRINTF | 4618 | #undef SPRINTF |
4619 | #define SPRINTF(args...) pos += sprintf(pos, args) | 4619 | #define SPRINTF(args...) seq_printf(m,##args) |
4620 | 4620 | ||
4621 | #undef YESNO | 4621 | #undef YESNO |
4622 | #define YESNO(YN) \ | 4622 | #define YESNO(YN) \ |
4623 | if (YN) SPRINTF(" Yes ");\ | 4623 | if (YN) SPRINTF(" Yes ");\ |
4624 | else SPRINTF(" No ") | 4624 | else SPRINTF(" No ") |
4625 | 4625 | ||
4626 | static int dc395x_proc_info(struct Scsi_Host *host, char *buffer, | 4626 | static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host) |
4627 | char **start, off_t offset, int length, int inout) | ||
4628 | { | 4627 | { |
4629 | struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata; | 4628 | struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata; |
4630 | int spd, spd1; | 4629 | int spd, spd1; |
4631 | char *pos = buffer; | ||
4632 | struct DeviceCtlBlk *dcb; | 4630 | struct DeviceCtlBlk *dcb; |
4633 | unsigned long flags; | 4631 | unsigned long flags; |
4634 | int dev; | 4632 | int dev; |
4635 | 4633 | ||
4636 | if (inout) /* Has data been written to the file ? */ | ||
4637 | return -EPERM; | ||
4638 | |||
4639 | SPRINTF(DC395X_BANNER " PCI SCSI Host Adapter\n"); | 4634 | SPRINTF(DC395X_BANNER " PCI SCSI Host Adapter\n"); |
4640 | SPRINTF(" Driver Version " DC395X_VERSION "\n"); | 4635 | SPRINTF(" Driver Version " DC395X_VERSION "\n"); |
4641 | 4636 | ||
@@ -4735,22 +4730,15 @@ static int dc395x_proc_info(struct Scsi_Host *host, char *buffer, | |||
4735 | SPRINTF("END\n"); | 4730 | SPRINTF("END\n"); |
4736 | } | 4731 | } |
4737 | 4732 | ||
4738 | *start = buffer + offset; | ||
4739 | DC395x_UNLOCK_IO(acb->scsi_host, flags); | 4733 | DC395x_UNLOCK_IO(acb->scsi_host, flags); |
4740 | 4734 | return 0; | |
4741 | if (pos - buffer < offset) | ||
4742 | return 0; | ||
4743 | else if (pos - buffer - offset < length) | ||
4744 | return pos - buffer - offset; | ||
4745 | else | ||
4746 | return length; | ||
4747 | } | 4735 | } |
4748 | 4736 | ||
4749 | 4737 | ||
4750 | static struct scsi_host_template dc395x_driver_template = { | 4738 | static struct scsi_host_template dc395x_driver_template = { |
4751 | .module = THIS_MODULE, | 4739 | .module = THIS_MODULE, |
4752 | .proc_name = DC395X_NAME, | 4740 | .proc_name = DC395X_NAME, |
4753 | .proc_info = dc395x_proc_info, | 4741 | .show_info = dc395x_show_info, |
4754 | .name = DC395X_BANNER " " DC395X_VERSION, | 4742 | .name = DC395X_BANNER " " DC395X_VERSION, |
4755 | .queuecommand = dc395x_queue_command, | 4743 | .queuecommand = dc395x_queue_command, |
4756 | .bios_param = dc395x_bios_param, | 4744 | .bios_param = dc395x_bios_param, |