Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

imm: switch to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro fa5fd368 3e0552ee

+11 -29
+11 -29
drivers/scsi/imm.c
··· 121 121 * testing... 122 122 * Also gives a method to use a script to obtain optimum timings (TODO) 123 123 */ 124 - static inline int imm_proc_write(imm_struct *dev, char *buffer, int length) 124 + static 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 128 if ((length > 5) && (strncmp(buffer, "mode=", 5) == 0)) { 129 - x = simple_strtoul(buffer + 5, NULL, 0); 130 - dev->mode = x; 129 + dev->mode = simple_strtoul(buffer + 5, NULL, 0); 131 130 return length; 132 131 } 133 132 printk("imm /proc: invalid variable\n"); 134 - return (-EINVAL); 133 + return -EINVAL; 135 134 } 136 135 137 - static int imm_proc_info(struct Scsi_Host *host, char *buffer, char **start, 138 - off_t offset, int length, int inout) 136 + static int imm_show_info(struct seq_file *m, struct Scsi_Host *host) 139 137 { 140 138 imm_struct *dev = imm_dev(host); 141 - int len = 0; 142 139 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 - 154 - /* Request for beyond end of buffer */ 155 - if (offset > len) 156 - return 0; 157 - 158 - *start = buffer + offset; 159 - len -= offset; 160 - if (len > length) 161 - len = length; 162 - return len; 140 + seq_printf(m, "Version : %s\n", IMM_VERSION); 141 + seq_printf(m, "Parport : %s\n", dev->dev->port->name); 142 + seq_printf(m, "Mode : %s\n", IMM_MODE_STRING[dev->mode]); 143 + return 0; 163 144 } 164 145 165 146 #if IMM_DEBUG > 0 ··· 1099 1118 static struct scsi_host_template imm_template = { 1100 1119 .module = THIS_MODULE, 1101 1120 .proc_name = "imm", 1102 - .proc_info = imm_proc_info, 1121 + .show_info = imm_show_info, 1122 + .write_info = imm_write_info, 1103 1123 .name = "Iomega VPI2 (imm) interface", 1104 1124 .queuecommand = imm_queuecommand, 1105 1125 .eh_abort_handler = imm_abort,