Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c888aa4 authored by Emil Goode's avatar Emil Goode Committed by Florian Tobias Schandinat
Browse files

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: default avatarEmil Goode <emilgoode@gmail.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 70b6eaee
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -353,18 +353,16 @@ adv7393_read_proc(char *page, char **start, off_t off,


static int
static int
adv7393_write_proc(struct file *file, const char __user * buffer,
adv7393_write_proc(struct file *file, const char __user * buffer,
		   unsigned long count, void *data)
		   size_t count, void *data)
{
{
	struct adv7393fb_device *fbdev = data;
	struct adv7393fb_device *fbdev = data;
	char line[8];
	unsigned int val;
	unsigned int val;
	int ret;
	int ret;


	ret = copy_from_user(line, buffer, count);
	ret = kstrtouint_from_user(buffer, count, 0, &val);
	if (ret)
	if (ret)
		return -EFAULT;
		return -EFAULT;


	val = simple_strtoul(line, NULL, 0);
	adv7393_write(fbdev->client, val >> 8, val & 0xff);
	adv7393_write(fbdev->client, val >> 8, val & 0xff);


	return count;
	return count;