Patchwork macintosh: ams: replace strict_strtoul() with kstrtoul()

login
register
mail settings
Submitter Jingoo Han
Date July 19, 2013, 7:16 a.m.
Message ID <001501ce844f$f3ddb840$db9928c0$@samsung.com>
Download mbox | patch
Permalink /patch/260192/
State Accepted
Commit 7033b64b48a3eafdd5d5f541ff6ccb96f69d9911
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Jingoo Han - July 19, 2013, 7:16 a.m.
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/macintosh/ams/ams-input.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/drivers/macintosh/ams/ams-input.c b/drivers/macintosh/ams/ams-input.c
index b27e530..2edae7d 100644
--- a/drivers/macintosh/ams/ams-input.c
+++ b/drivers/macintosh/ams/ams-input.c
@@ -118,8 +118,12 @@  static ssize_t ams_input_store_joystick(struct device *dev,
 {
 	unsigned long enable;
 	int error = 0;
+	int ret;
 
-	if (strict_strtoul(buf, 0, &enable) || enable > 1)
+	ret = kstrtoul(buf, 0, &enable);
+	if (ret)
+		return ret;
+	if (enable > 1)
 		return -EINVAL;
 
 	mutex_lock(&ams_input_mutex);