summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2015-02-06 18:49:23 -0800
committerDarren Hart <dvhart@linux.intel.com>2015-02-06 18:53:59 -0800
commit802cf2e1e0f202507b6e21b7a12da56d5c86af62 (patch)
treeaddb20e83ff037c6d5ed69a13572dc3d074c128a /drivers/platform
parent4e7f09ad5ea98ae60a435575ae877bd68a5f2d5c (diff)
downloadlinux-802cf2e1e0f202507b6e21b7a12da56d5c86af62.tar.gz
linux-802cf2e1e0f202507b6e21b7a12da56d5c86af62.tar.bz2
linux-802cf2e1e0f202507b6e21b7a12da56d5c86af62.zip
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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/samsung-laptop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index 3257b0228613..9e701b2256f9 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -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);