aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/bfin_adv7393fb.c
diff options
context:
space:
mode:
authorEmil Goode <emilgoode@gmail.com>2012-05-29 12:57:00 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-06-05 17:47:26 -0400
commit5c888aa43ee9872efe2a09e8c9f03db84f60dd28 (patch)
treeb71a1b8006c67ed7051bdb559c031cebe20303ad /drivers/video/bfin_adv7393fb.c
parent70b6eaee405d657927244067ab2a466425745a0e (diff)
video: bfin_adv7393fb: Convert to kstrtouint_from_user
This patch removes a call to the deprecated simple_strtoul function and simplifies the code by replacing two function calls with one call to kstrtouint_from_user. -Simplify the adv7393_write_proc function by replacing the simple_strtoul and copy_from_user calls with one call to kstrtouint_from_user. -Change the count parameter from unsigned long to size_t as this is the type that the kstrtouint_from_user function expects. (size_t is what will be passed to the adv7393_write_proc function by the proc write handler function proc_file_write anyway) Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/bfin_adv7393fb.c')
-rw-r--r--drivers/video/bfin_adv7393fb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c
index 33ea874c87d..9bdd4b0c18c 100644
--- a/drivers/video/bfin_adv7393fb.c
+++ b/drivers/video/bfin_adv7393fb.c
@@ -353,18 +353,16 @@ adv7393_read_proc(char *page, char **start, off_t off,
353 353
354static int 354static int
355adv7393_write_proc(struct file *file, const char __user * buffer, 355adv7393_write_proc(struct file *file, const char __user * buffer,
356 unsigned long count, void *data) 356 size_t count, void *data)
357{ 357{
358 struct adv7393fb_device *fbdev = data; 358 struct adv7393fb_device *fbdev = data;
359 char line[8];
360 unsigned int val; 359 unsigned int val;
361 int ret; 360 int ret;
362 361
363 ret = copy_from_user(line, buffer, count); 362 ret = kstrtouint_from_user(buffer, count, 0, &val);
364 if (ret) 363 if (ret)
365 return -EFAULT; 364 return -EFAULT;
366 365
367 val = simple_strtoul(line, NULL, 0);
368 adv7393_write(fbdev->client, val >> 8, val & 0xff); 366 adv7393_write(fbdev->client, val >> 8, val & 0xff);
369 367
370 return count; 368 return count;