aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /arch/xtensa
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/iss/simdisk.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c
index f58ffc3b68a8..4a06d70ddf5e 100644
--- a/arch/xtensa/platforms/iss/simdisk.c
+++ b/arch/xtensa/platforms/iss/simdisk.c
@@ -214,20 +214,27 @@ static int simdisk_detach(struct simdisk *dev)
214 return err; 214 return err;
215} 215}
216 216
217static int proc_read_simdisk(char *page, char **start, off_t off, 217static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
218 int count, int *eof, void *data) 218 size_t size, loff_t *ppos)
219{ 219{
220 int len; 220 struct simdisk *dev = PDE_DATA(file_inode(file));
221 struct simdisk *dev = (struct simdisk *) data; 221 char *s = dev->filename;
222 len = sprintf(page, "%s\n", dev->filename ? dev->filename : ""); 222 if (s) {
223 return len; 223 ssize_t n = simple_read_from_buffer(buf, size, ppos,
224 s, strlen(s));
225 if (n < 0)
226 return n;
227 buf += n;
228 size -= n;
229 }
230 return simple_read_from_buffer(buf, size, ppos, "\n", 1);
224} 231}
225 232
226static int proc_write_simdisk(struct file *file, const char *buffer, 233static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
227 unsigned long count, void *data) 234 size_t size, loff_t *ppos)
228{ 235{
229 char *tmp = kmalloc(count + 1, GFP_KERNEL); 236 char *tmp = kmalloc(count + 1, GFP_KERNEL);
230 struct simdisk *dev = (struct simdisk *) data; 237 struct simdisk *dev = PDE_DATA(file_inode(file));
231 int err; 238 int err;
232 239
233 if (tmp == NULL) 240 if (tmp == NULL)
@@ -256,6 +263,12 @@ out_free:
256 return err; 263 return err;
257} 264}
258 265
266static const struct file_operations fops = {
267 .read = proc_read_simdisk,
268 .write = proc_write_simdisk,
269 .llseek = default_llseek,
270};
271
259static int __init simdisk_setup(struct simdisk *dev, int which, 272static int __init simdisk_setup(struct simdisk *dev, int which,
260 struct proc_dir_entry *procdir) 273 struct proc_dir_entry *procdir)
261{ 274{
@@ -289,10 +302,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,
289 set_capacity(dev->gd, 0); 302 set_capacity(dev->gd, 0);
290 add_disk(dev->gd); 303 add_disk(dev->gd);
291 304
292 dev->procfile = create_proc_entry(tmp, 0644, procdir); 305 dev->procfile = proc_create_data(tmp, 0644, procdir, &fops, dev);
293 dev->procfile->data = dev;
294 dev->procfile->read_proc = proc_read_simdisk;
295 dev->procfile->write_proc = proc_write_simdisk;
296 return 0; 306 return 0;
297 307
298out_alloc_disk: 308out_alloc_disk: