aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/imm.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 00:55:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:16 -0400
commitfa5fd36820efdc82fc9ac8ac9bd47ddc2fee3d37 (patch)
treeecbfc7c6ff00acfb3dd5af6d94bf0d1632bd578e /drivers/scsi/imm.c
parent3e0552eebdf621504eaec7786613ef94a63463a0 (diff)
imm: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/scsi/imm.c')
-rw-r--r--drivers/scsi/imm.c40
1 files changed, 11 insertions, 29 deletions
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 26cd9d1d7571..89a8266560d0 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -121,45 +121,26 @@ static inline void imm_pb_release(imm_struct *dev)
121 * testing... 121 * testing...
122 * Also gives a method to use a script to obtain optimum timings (TODO) 122 * Also gives a method to use a script to obtain optimum timings (TODO)
123 */ 123 */
124static inline int imm_proc_write(imm_struct *dev, char *buffer, int length) 124static int imm_write_info(struct Scsi_Host *host, char *buffer, int length)
125{ 125{
126 unsigned long x; 126 imm_struct *dev = imm_dev(host);
127 127
128 if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) { 128 if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) {
129 x = simple_strtoul(buffer + 5, NULL, 0); 129 dev->mode = simple_strtoul(buffer + 5, NULL, 0);
130 dev->mode = x;
131 return length; 130 return length;
132 } 131 }
133 printk("imm /proc: invalid variable\n"); 132 printk("imm /proc: invalid variable\n");
134 return (-EINVAL); 133 return -EINVAL;
135} 134}
136 135
137static int imm_proc_info(struct Scsi_Host *host, char *buffer, char **start, 136static int imm_show_info(struct seq_file *m, struct Scsi_Host *host)
138 off_t offset, int length, int inout)
139{ 137{
140 imm_struct *dev = imm_dev(host); 138 imm_struct *dev = imm_dev(host);
141 int len = 0;
142
143 if (inout)
144 return imm_proc_write(dev, buffer, length);
145
146 len += sprintf(buffer + len, "Version : %s\n", IMM_VERSION);
147 len +=
148 sprintf(buffer + len, "Parport : %s\n",
149 dev->dev->port->name);
150 len +=
151 sprintf(buffer + len, "Mode : %s\n",
152 IMM_MODE_STRING[dev->mode]);
153 139
154 /* Request for beyond end of buffer */ 140 seq_printf(m, "Version : %s\n", IMM_VERSION);
155 if (offset > len) 141 seq_printf(m, "Parport : %s\n", dev->dev->port->name);
156 return 0; 142 seq_printf(m, "Mode : %s\n", IMM_MODE_STRING[dev->mode]);
157 143 return 0;
158 *start = buffer + offset;
159 len -= offset;
160 if (len > length)
161 len = length;
162 return len;
163} 144}
164 145
165#if IMM_DEBUG > 0 146#if IMM_DEBUG > 0
@@ -1118,7 +1099,8 @@ static int imm_adjust_queue(struct scsi_device *device)
1118static struct scsi_host_template imm_template = { 1099static struct scsi_host_template imm_template = {
1119 .module = THIS_MODULE, 1100 .module = THIS_MODULE,
1120 .proc_name = "imm", 1101 .proc_name = "imm",
1121 .proc_info = imm_proc_info, 1102 .show_info = imm_show_info,
1103 .write_info = imm_write_info,
1122 .name = "Iomega VPI2 (imm) interface", 1104 .name = "Iomega VPI2 (imm) interface",
1123 .queuecommand = imm_queuecommand, 1105 .queuecommand = imm_queuecommand,
1124 .eh_abort_handler = imm_abort, 1106 .eh_abort_handler = imm_abort,