samsung-laptop.c: Prefer kstrtoint over single variable sscanf

Replace existing usage of single variable sscanf with kstrtoint for
consistency with checkpatch warnings against such usage.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
Darren Hart 2015-02-06 18:49:23 -08:00
parent 4e7f09ad5e
commit 802cf2e1e0

View File

@ -768,7 +768,7 @@ static ssize_t set_battery_life_extender(struct device *dev,
struct samsung_laptop *samsung = dev_get_drvdata(dev);
int ret, value;
if (!count || sscanf(buf, "%i", &value) != 1)
if (!count || kstrtoint(buf, 0, &value) != 0)
return -EINVAL;
ret = write_battery_life_extender(samsung, !!value);
@ -837,7 +837,7 @@ static ssize_t set_usb_charge(struct device *dev,
struct samsung_laptop *samsung = dev_get_drvdata(dev);
int ret, value;
if (!count || sscanf(buf, "%i", &value) != 1)
if (!count || kstrtoint(buf, 0, &value) != 0)
return -EINVAL;
ret = write_usb_charge(samsung, !!value);