diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
commit | 20b4fb485227404329e41ad15588afad3df23050 (patch) | |
tree | f3e099f0ab3da8a93b447203e294d2bb22f6dc05 /drivers/video/bfin_adv7393fb.c | |
parent | b9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff) | |
parent | ac3e3c5b1164397656df81b9e9ab4991184d3236 (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 'drivers/video/bfin_adv7393fb.c')
-rw-r--r-- | drivers/video/bfin_adv7393fb.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c index 8d411a3c9966..a54f7f7d763b 100644 --- a/drivers/video/bfin_adv7393fb.c +++ b/drivers/video/bfin_adv7393fb.c | |||
@@ -333,29 +333,23 @@ static int proc_output(char *buf) | |||
333 | return p - buf; | 333 | return p - buf; |
334 | } | 334 | } |
335 | 335 | ||
336 | static int | 336 | static ssize_t |
337 | adv7393_read_proc(char *page, char **start, off_t off, | 337 | adv7393_read_proc(struct file *file, char __user *buf, |
338 | int count, int *eof, void *data) | 338 | size_t size, loff_t *ppos) |
339 | { | 339 | { |
340 | int len; | 340 | static const char message[] = "Usage:\n" |
341 | 341 | "echo 0x[REG][Value] > adv7393\n" | |
342 | len = proc_output(page); | 342 | "example: echo 0x1234 >adv7393\n" |
343 | if (len <= off + count) | 343 | "writes 0x34 into Register 0x12\n"; |
344 | *eof = 1; | 344 | return simple_read_from_buffer(buf, size, ppos, message, |
345 | *start = page + off; | 345 | sizeof(message)); |
346 | len -= off; | ||
347 | if (len > count) | ||
348 | len = count; | ||
349 | if (len < 0) | ||
350 | len = 0; | ||
351 | return len; | ||
352 | } | 346 | } |
353 | 347 | ||
354 | static int | 348 | static ssize_t |
355 | adv7393_write_proc(struct file *file, const char __user * buffer, | 349 | adv7393_write_proc(struct file *file, const char __user * buffer, |
356 | size_t count, void *data) | 350 | size_t count, loff_t *ppos) |
357 | { | 351 | { |
358 | struct adv7393fb_device *fbdev = data; | 352 | struct adv7393fb_device *fbdev = PDE_DATA(file_inode(file)); |
359 | unsigned int val; | 353 | unsigned int val; |
360 | int ret; | 354 | int ret; |
361 | 355 | ||
@@ -368,6 +362,12 @@ adv7393_write_proc(struct file *file, const char __user * buffer, | |||
368 | return count; | 362 | return count; |
369 | } | 363 | } |
370 | 364 | ||
365 | static const struct file_operations fops = { | ||
366 | .read = adv7393_read_proc, | ||
367 | .write = adv7393_write_proc, | ||
368 | .llseek = default_llseek, | ||
369 | }; | ||
370 | |||
371 | static int bfin_adv7393_fb_probe(struct i2c_client *client, | 371 | static int bfin_adv7393_fb_probe(struct i2c_client *client, |
372 | const struct i2c_device_id *id) | 372 | const struct i2c_device_id *id) |
373 | { | 373 | { |
@@ -506,17 +506,12 @@ static int bfin_adv7393_fb_probe(struct i2c_client *client, | |||
506 | fbdev->info.node, fbdev->info.fix.id); | 506 | fbdev->info.node, fbdev->info.fix.id); |
507 | dev_info(&client->dev, "fb memory address : 0x%p\n", fbdev->fb_mem); | 507 | dev_info(&client->dev, "fb memory address : 0x%p\n", fbdev->fb_mem); |
508 | 508 | ||
509 | entry = create_proc_entry("driver/adv7393", 0, NULL); | 509 | entry = proc_create_data("driver/adv7393", 0, NULL, &fops, fbdev); |
510 | if (!entry) { | 510 | if (!entry) { |
511 | dev_err(&client->dev, "unable to create /proc entry\n"); | 511 | dev_err(&client->dev, "unable to create /proc entry\n"); |
512 | ret = -EFAULT; | 512 | ret = -EFAULT; |
513 | goto free_fb; | 513 | goto free_fb; |
514 | } | 514 | } |
515 | |||
516 | entry->read_proc = adv7393_read_proc; | ||
517 | entry->write_proc = adv7393_write_proc; | ||
518 | entry->data = fbdev; | ||
519 | |||
520 | return 0; | 515 | return 0; |
521 | 516 | ||
522 | free_fb: | 517 | free_fb: |