diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 03:18:35 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:23 -0400 |
commit | 8c986544562b667766f42e08a206f6c2e21d272c (patch) | |
tree | 9e0c57d8cf6c715498d46c10d726987ed05fdad2 | |
parent | e633c1e55731cd3e85285aa0c792dafb54ae7225 (diff) |
eata_pio: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/scsi/eata_pio.c | 56 |
1 files changed, 10 insertions, 46 deletions
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c index d5f8362335d3..356def44ce58 100644 --- a/drivers/scsi/eata_pio.c +++ b/drivers/scsi/eata_pio.c | |||
@@ -92,58 +92,22 @@ static unsigned long queue_counter; | |||
92 | 92 | ||
93 | static struct scsi_host_template driver_template; | 93 | static struct scsi_host_template driver_template; |
94 | 94 | ||
95 | /* | 95 | static int eata_pio_show_info(struct seq_file *m, struct Scsi_Host *shost) |
96 | * eata_proc_info | ||
97 | * inout : decides on the direction of the dataflow and the meaning of the | ||
98 | * variables | ||
99 | * buffer: If inout==FALSE data is being written to it else read from it | ||
100 | * *start: If inout==FALSE start of the valid data in the buffer | ||
101 | * offset: If inout==FALSE offset from the beginning of the imaginary file | ||
102 | * from which we start writing into the buffer | ||
103 | * length: If inout==FALSE max number of bytes to be written into the buffer | ||
104 | * else number of bytes in the buffer | ||
105 | */ | ||
106 | static int eata_pio_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, | ||
107 | int length, int rw) | ||
108 | { | 96 | { |
109 | int len = 0; | 97 | seq_printf(m, "EATA (Extended Attachment) PIO driver version: " |
110 | off_t begin = 0, pos = 0; | ||
111 | |||
112 | if (rw) | ||
113 | return -ENOSYS; | ||
114 | |||
115 | len += sprintf(buffer+len, "EATA (Extended Attachment) PIO driver version: " | ||
116 | "%d.%d%s\n",VER_MAJOR, VER_MINOR, VER_SUB); | 98 | "%d.%d%s\n",VER_MAJOR, VER_MINOR, VER_SUB); |
117 | len += sprintf(buffer + len, "queued commands: %10ld\n" | 99 | seq_printf(m, "queued commands: %10ld\n" |
118 | "processed interrupts:%10ld\n", queue_counter, int_counter); | 100 | "processed interrupts:%10ld\n", queue_counter, int_counter); |
119 | len += sprintf(buffer + len, "\nscsi%-2d: HBA %.10s\n", | 101 | seq_printf(m, "\nscsi%-2d: HBA %.10s\n", |
120 | shost->host_no, SD(shost)->name); | 102 | shost->host_no, SD(shost)->name); |
121 | len += sprintf(buffer + len, "Firmware revision: v%s\n", | 103 | seq_printf(m, "Firmware revision: v%s\n", |
122 | SD(shost)->revision); | 104 | SD(shost)->revision); |
123 | len += sprintf(buffer + len, "IO: PIO\n"); | 105 | seq_printf(m, "IO: PIO\n"); |
124 | len += sprintf(buffer + len, "Base IO : %#.4x\n", (u32) shost->base); | 106 | seq_printf(m, "Base IO : %#.4x\n", (u32) shost->base); |
125 | len += sprintf(buffer + len, "Host Bus: %s\n", | 107 | seq_printf(m, "Host Bus: %s\n", |
126 | (SD(shost)->bustype == 'P')?"PCI ": | 108 | (SD(shost)->bustype == 'P')?"PCI ": |
127 | (SD(shost)->bustype == 'E')?"EISA":"ISA "); | 109 | (SD(shost)->bustype == 'E')?"EISA":"ISA "); |
128 | 110 | return 0; | |
129 | pos = begin + len; | ||
130 | |||
131 | if (pos < offset) { | ||
132 | len = 0; | ||
133 | begin = pos; | ||
134 | } | ||
135 | if (pos > offset + length) | ||
136 | goto stop_output; | ||
137 | |||
138 | stop_output: | ||
139 | DBG(DBG_PROC, printk("2pos: %ld offset: %ld len: %d\n", pos, offset, len)); | ||
140 | *start = buffer + (offset - begin); /* Start of wanted data */ | ||
141 | len -= (offset - begin); /* Start slop */ | ||
142 | if (len > length) | ||
143 | len = length; /* Ending slop */ | ||
144 | DBG(DBG_PROC, printk("3pos: %ld offset: %ld len: %d\n", pos, offset, len)); | ||
145 | |||
146 | return len; | ||
147 | } | 111 | } |
148 | 112 | ||
149 | static int eata_pio_release(struct Scsi_Host *sh) | 113 | static int eata_pio_release(struct Scsi_Host *sh) |
@@ -985,7 +949,7 @@ static int eata_pio_detect(struct scsi_host_template *tpnt) | |||
985 | static struct scsi_host_template driver_template = { | 949 | static struct scsi_host_template driver_template = { |
986 | .proc_name = "eata_pio", | 950 | .proc_name = "eata_pio", |
987 | .name = "EATA (Extended Attachment) PIO driver", | 951 | .name = "EATA (Extended Attachment) PIO driver", |
988 | .proc_info = eata_pio_proc_info, | 952 | .show_info = eata_pio_show_info, |
989 | .detect = eata_pio_detect, | 953 | .detect = eata_pio_detect, |
990 | .release = eata_pio_release, | 954 | .release = eata_pio_release, |
991 | .queuecommand = eata_pio_queue, | 955 | .queuecommand = eata_pio_queue, |