.. | .. |
---|
192 | 192 | |
---|
193 | 193 | // --------------------------------------------------------------------------- |
---|
194 | 194 | |
---|
195 | | -static void *capi_driver_start(struct seq_file *seq, loff_t *pos) |
---|
196 | | - __acquires(&capi_drivers_lock) |
---|
| 195 | +/* /proc/capi/drivers is always empty */ |
---|
| 196 | +static ssize_t empty_read(struct file *file, char __user *buf, |
---|
| 197 | + size_t size, loff_t *off) |
---|
197 | 198 | { |
---|
198 | | - mutex_lock(&capi_drivers_lock); |
---|
199 | | - return seq_list_start(&capi_drivers, *pos); |
---|
200 | | -} |
---|
201 | | - |
---|
202 | | -static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos) |
---|
203 | | -{ |
---|
204 | | - return seq_list_next(v, &capi_drivers, pos); |
---|
205 | | -} |
---|
206 | | - |
---|
207 | | -static void capi_driver_stop(struct seq_file *seq, void *v) |
---|
208 | | - __releases(&capi_drivers_lock) |
---|
209 | | -{ |
---|
210 | | - mutex_unlock(&capi_drivers_lock); |
---|
211 | | -} |
---|
212 | | - |
---|
213 | | -static int capi_driver_show(struct seq_file *seq, void *v) |
---|
214 | | -{ |
---|
215 | | - struct capi_driver *drv = list_entry(v, struct capi_driver, list); |
---|
216 | | - |
---|
217 | | - seq_printf(seq, "%-32s %s\n", drv->name, drv->revision); |
---|
218 | 199 | return 0; |
---|
219 | 200 | } |
---|
220 | 201 | |
---|
221 | | -static const struct seq_operations seq_capi_driver_ops = { |
---|
222 | | - .start = capi_driver_start, |
---|
223 | | - .next = capi_driver_next, |
---|
224 | | - .stop = capi_driver_stop, |
---|
225 | | - .show = capi_driver_show, |
---|
| 202 | +static const struct proc_ops empty_proc_ops = { |
---|
| 203 | + .proc_read = empty_read, |
---|
226 | 204 | }; |
---|
227 | 205 | |
---|
228 | 206 | // --------------------------------------------------------------------------- |
---|
.. | .. |
---|
236 | 214 | proc_create_seq("capi/contrstats", 0, NULL, &seq_contrstats_ops); |
---|
237 | 215 | proc_create_seq("capi/applications", 0, NULL, &seq_applications_ops); |
---|
238 | 216 | proc_create_seq("capi/applstats", 0, NULL, &seq_applstats_ops); |
---|
239 | | - proc_create_seq("capi/driver", 0, NULL, &seq_capi_driver_ops); |
---|
| 217 | + proc_create("capi/driver", 0, NULL, &empty_proc_ops); |
---|
240 | 218 | } |
---|
241 | 219 | |
---|
242 | | -void __exit |
---|
| 220 | +void |
---|
243 | 221 | kcapi_proc_exit(void) |
---|
244 | 222 | { |
---|
245 | 223 | remove_proc_entry("capi/driver", NULL); |
---|