Commit 70ef457dc92bdd03c0c8d640fce45909166983a1

Authored by Al Viro
1 parent d89537e1b1

scsi: bury ->proc_info()

all users converted to ->show_info()/->write_info()

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

Showing 2 changed files with 9 additions and 73 deletions Side-by-side Diff

drivers/scsi/scsi_proc.c
... ... @@ -45,58 +45,6 @@
45 45 /* Protect sht->present and sht->proc_dir */
46 46 static DEFINE_MUTEX(global_host_template_mutex);
47 47  
48   -/**
49   - * proc_scsi_read - handle read from /proc by calling host's proc_info() command
50   - * @buffer: passed to proc_info
51   - * @start: passed to proc_info
52   - * @offset: passed to proc_info
53   - * @length: passed to proc_info
54   - * @eof: returns whether length read was less than requested
55   - * @data: pointer to a &struct Scsi_Host
56   - */
57   -
58   -static int proc_scsi_read(char *buffer, char **start, off_t offset,
59   - int length, int *eof, void *data)
60   -{
61   - struct Scsi_Host *shost = data;
62   - int n;
63   -
64   - n = shost->hostt->proc_info(shost, buffer, start, offset, length, 0);
65   - *eof = (n < length);
66   -
67   - return n;
68   -}
69   -
70   -/**
71   - * proc_scsi_write_proc - Handle write to /proc by calling host's proc_info()
72   - * @file: not used
73   - * @buf: source of data to write.
74   - * @count: number of bytes (at most PROC_BLOCK_SIZE) to write.
75   - * @data: pointer to &struct Scsi_Host
76   - */
77   -static int proc_scsi_write_proc(struct file *file, const char __user *buf,
78   - unsigned long count, void *data)
79   -{
80   - struct Scsi_Host *shost = data;
81   - ssize_t ret = -ENOMEM;
82   - char *page;
83   - char *start;
84   -
85   - if (count > PROC_BLOCK_SIZE)
86   - return -EOVERFLOW;
87   -
88   - page = (char *)__get_free_page(GFP_KERNEL);
89   - if (page) {
90   - ret = -EFAULT;
91   - if (copy_from_user(page, buf, count))
92   - goto out;
93   - ret = shost->hostt->proc_info(shost, page, &start, 0, count, 1);
94   - }
95   -out:
96   - free_page((unsigned long)page);
97   - return ret;
98   -}
99   -
100 48 static ssize_t proc_scsi_host_write(struct file *file, const char __user *buf,
101 49 size_t count, loff_t *ppos)
102 50 {
... ... @@ -149,7 +97,7 @@
149 97  
150 98 void scsi_proc_hostdir_add(struct scsi_host_template *sht)
151 99 {
152   - if (!sht->proc_info && !sht->show_info)
  100 + if (!sht->show_info)
153 101 return;
154 102  
155 103 mutex_lock(&global_host_template_mutex);
... ... @@ -168,7 +116,7 @@
168 116 */
169 117 void scsi_proc_hostdir_rm(struct scsi_host_template *sht)
170 118 {
171   - if (!sht->proc_info && !sht->show_info)
  119 + if (!sht->show_info)
172 120 return;
173 121  
174 122 mutex_lock(&global_host_template_mutex);
... ... @@ -194,23 +142,12 @@
194 142 return;
195 143  
196 144 sprintf(name,"%d", shost->host_no);
197   - if (sht->show_info) {
198   - p = proc_create_data(name, S_IRUGO | S_IWUSR,
199   - sht->proc_dir, &proc_scsi_fops, shost);
200   - if (!p)
201   - goto Fail;
202   - return;
203   - }
204   - p = create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
205   - sht->proc_dir, proc_scsi_read, shost);
206   - if (p) {
207   - p->write_proc = proc_scsi_write_proc;
208   - return;
209   - }
210   -Fail:
211   - printk(KERN_ERR "%s: Failed to register host %d in"
212   - "%s\n", __func__, shost->host_no,
213   - sht->proc_name);
  145 + p = proc_create_data(name, S_IRUGO | S_IWUSR,
  146 + sht->proc_dir, &proc_scsi_fops, shost);
  147 + if (!p)
  148 + printk(KERN_ERR "%s: Failed to register host %d in"
  149 + "%s\n", __func__, shost->host_no,
  150 + sht->proc_name);
214 151 }
215 152  
216 153 /**
include/scsi/scsi_host.h
... ... @@ -341,7 +341,6 @@
341 341 *
342 342 * Status: OBSOLETE
343 343 */
344   - int (*proc_info)(struct Scsi_Host *, char *, char **, off_t, int, int);
345 344 int (*show_info)(struct seq_file *, struct Scsi_Host *);
346 345 int (*write_info)(struct Scsi_Host *, char *, int);
347 346  
... ... @@ -378,7 +377,7 @@
378 377  
379 378 /*
380 379 * Used to store the procfs directory if a driver implements the
381   - * proc_info or show_info method.
  380 + * show_info method.
382 381 */
383 382 struct proc_dir_entry *proc_dir;
384 383