diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 12:02:39 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:27 -0400 |
commit | 56b8e8e53523c9a3e1ffacadf35c389fdb427a34 (patch) | |
tree | 54d82a854d029670d602bff07990234d37d27a30 | |
parent | 9d4e5c54a3b67cc0246afe0274ba028a85e79a10 (diff) |
acornscsi: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/scsi/arm/acornscsi.c | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 3e1172adb37b..09ba1869d366 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c | |||
@@ -2836,20 +2836,15 @@ char *acornscsi_info(struct Scsi_Host *host) | |||
2836 | return string; | 2836 | return string; |
2837 | } | 2837 | } |
2838 | 2838 | ||
2839 | int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start, off_t offset, | 2839 | static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance) |
2840 | int length, int inout) | ||
2841 | { | 2840 | { |
2842 | int pos, begin = 0, devidx; | 2841 | int devidx; |
2843 | struct scsi_device *scd; | 2842 | struct scsi_device *scd; |
2844 | AS_Host *host; | 2843 | AS_Host *host; |
2845 | char *p = buffer; | ||
2846 | |||
2847 | if (inout == 1) | ||
2848 | return -EINVAL; | ||
2849 | 2844 | ||
2850 | host = (AS_Host *)instance->hostdata; | 2845 | host = (AS_Host *)instance->hostdata; |
2851 | 2846 | ||
2852 | p += sprintf(p, "AcornSCSI driver v%d.%d.%d" | 2847 | seq_printf(m, "AcornSCSI driver v%d.%d.%d" |
2853 | #ifdef CONFIG_SCSI_ACORNSCSI_SYNC | 2848 | #ifdef CONFIG_SCSI_ACORNSCSI_SYNC |
2854 | " SYNC" | 2849 | " SYNC" |
2855 | #endif | 2850 | #endif |
@@ -2864,14 +2859,14 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start, | |||
2864 | #endif | 2859 | #endif |
2865 | "\n\n", VER_MAJOR, VER_MINOR, VER_PATCH); | 2860 | "\n\n", VER_MAJOR, VER_MINOR, VER_PATCH); |
2866 | 2861 | ||
2867 | p += sprintf(p, "SBIC: WD33C93A Address: %p IRQ : %d\n", | 2862 | seq_printf(m, "SBIC: WD33C93A Address: %p IRQ : %d\n", |
2868 | host->base + SBIC_REGIDX, host->scsi.irq); | 2863 | host->base + SBIC_REGIDX, host->scsi.irq); |
2869 | #ifdef USE_DMAC | 2864 | #ifdef USE_DMAC |
2870 | p += sprintf(p, "DMAC: uPC71071 Address: %p IRQ : %d\n\n", | 2865 | seq_printf(m, "DMAC: uPC71071 Address: %p IRQ : %d\n\n", |
2871 | host->base + DMAC_OFFSET, host->scsi.irq); | 2866 | host->base + DMAC_OFFSET, host->scsi.irq); |
2872 | #endif | 2867 | #endif |
2873 | 2868 | ||
2874 | p += sprintf(p, "Statistics:\n" | 2869 | seq_printf(m, "Statistics:\n" |
2875 | "Queued commands: %-10u Issued commands: %-10u\n" | 2870 | "Queued commands: %-10u Issued commands: %-10u\n" |
2876 | "Done commands : %-10u Reads : %-10u\n" | 2871 | "Done commands : %-10u Reads : %-10u\n" |
2877 | "Writes : %-10u Others : %-10u\n" | 2872 | "Writes : %-10u Others : %-10u\n" |
@@ -2886,7 +2881,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start, | |||
2886 | for (devidx = 0; devidx < 9; devidx ++) { | 2881 | for (devidx = 0; devidx < 9; devidx ++) { |
2887 | unsigned int statptr, prev; | 2882 | unsigned int statptr, prev; |
2888 | 2883 | ||
2889 | p += sprintf(p, "\n%c:", devidx == 8 ? 'H' : ('0' + devidx)); | 2884 | seq_printf(m, "\n%c:", devidx == 8 ? 'H' : ('0' + devidx)); |
2890 | statptr = host->status_ptr[devidx] - 10; | 2885 | statptr = host->status_ptr[devidx] - 10; |
2891 | 2886 | ||
2892 | if ((signed int)statptr < 0) | 2887 | if ((signed int)statptr < 0) |
@@ -2896,7 +2891,7 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start, | |||
2896 | 2891 | ||
2897 | for (; statptr != host->status_ptr[devidx]; statptr = (statptr + 1) & (STATUS_BUFFER_SIZE - 1)) { | 2892 | for (; statptr != host->status_ptr[devidx]; statptr = (statptr + 1) & (STATUS_BUFFER_SIZE - 1)) { |
2898 | if (host->status[devidx][statptr].when) { | 2893 | if (host->status[devidx][statptr].when) { |
2899 | p += sprintf(p, "%c%02X:%02X+%2ld", | 2894 | seq_printf(m, "%c%02X:%02X+%2ld", |
2900 | host->status[devidx][statptr].irq ? '-' : ' ', | 2895 | host->status[devidx][statptr].irq ? '-' : ' ', |
2901 | host->status[devidx][statptr].ph, | 2896 | host->status[devidx][statptr].ph, |
2902 | host->status[devidx][statptr].ssr, | 2897 | host->status[devidx][statptr].ssr, |
@@ -2907,51 +2902,32 @@ int acornscsi_proc_info(struct Scsi_Host *instance, char *buffer, char **start, | |||
2907 | } | 2902 | } |
2908 | } | 2903 | } |
2909 | 2904 | ||
2910 | p += sprintf(p, "\nAttached devices:\n"); | 2905 | seq_printf(m, "\nAttached devices:\n"); |
2911 | 2906 | ||
2912 | shost_for_each_device(scd, instance) { | 2907 | shost_for_each_device(scd, instance) { |
2913 | p += sprintf(p, "Device/Lun TaggedQ Sync\n"); | 2908 | seq_printf(m, "Device/Lun TaggedQ Sync\n"); |
2914 | p += sprintf(p, " %d/%d ", scd->id, scd->lun); | 2909 | seq_printf(m, " %d/%d ", scd->id, scd->lun); |
2915 | if (scd->tagged_supported) | 2910 | if (scd->tagged_supported) |
2916 | p += sprintf(p, "%3sabled(%3d) ", | 2911 | seq_printf(m, "%3sabled(%3d) ", |
2917 | scd->simple_tags ? "en" : "dis", | 2912 | scd->simple_tags ? "en" : "dis", |
2918 | scd->current_tag); | 2913 | scd->current_tag); |
2919 | else | 2914 | else |
2920 | p += sprintf(p, "unsupported "); | 2915 | seq_printf(m, "unsupported "); |
2921 | 2916 | ||
2922 | if (host->device[scd->id].sync_xfer & 15) | 2917 | if (host->device[scd->id].sync_xfer & 15) |
2923 | p += sprintf(p, "offset %d, %d ns\n", | 2918 | seq_printf(m, "offset %d, %d ns\n", |
2924 | host->device[scd->id].sync_xfer & 15, | 2919 | host->device[scd->id].sync_xfer & 15, |
2925 | acornscsi_getperiod(host->device[scd->id].sync_xfer)); | 2920 | acornscsi_getperiod(host->device[scd->id].sync_xfer)); |
2926 | else | 2921 | else |
2927 | p += sprintf(p, "async\n"); | 2922 | seq_printf(m, "async\n"); |
2928 | 2923 | ||
2929 | pos = p - buffer; | ||
2930 | if (pos + begin < offset) { | ||
2931 | begin += pos; | ||
2932 | p = buffer; | ||
2933 | } | ||
2934 | pos = p - buffer; | ||
2935 | if (pos + begin > offset + length) { | ||
2936 | scsi_device_put(scd); | ||
2937 | break; | ||
2938 | } | ||
2939 | } | 2924 | } |
2940 | 2925 | return 0; | |
2941 | pos = p - buffer; | ||
2942 | |||
2943 | *start = buffer + (offset - begin); | ||
2944 | pos -= offset - begin; | ||
2945 | |||
2946 | if (pos > length) | ||
2947 | pos = length; | ||
2948 | |||
2949 | return pos; | ||
2950 | } | 2926 | } |
2951 | 2927 | ||
2952 | static struct scsi_host_template acornscsi_template = { | 2928 | static struct scsi_host_template acornscsi_template = { |
2953 | .module = THIS_MODULE, | 2929 | .module = THIS_MODULE, |
2954 | .proc_info = acornscsi_proc_info, | 2930 | .show_info = acornscsi_show_info, |
2955 | .name = "AcornSCSI", | 2931 | .name = "AcornSCSI", |
2956 | .info = acornscsi_info, | 2932 | .info = acornscsi_info, |
2957 | .queuecommand = acornscsi_queuecmd, | 2933 | .queuecommand = acornscsi_queuecmd, |