mfd: aat2870-core: Stop using obsolte simple_strtoul()

This change “mfd: aat2870-core: Stop using obsolte simple_strtoul()” (commit 0ebc1c2) in Linux kernel is authored by Lee Jones <lee.jones [at] linaro.org> on Thu May 8 12:58:24 2014 +0100.

Description of "mfd: aat2870-core: Stop using obsolte simple_strtoul()"

The change “mfd: aat2870-core: Stop using obsolte simple_strtoul()” introduces changes as follows.

mfd: aat2870-core: Stop using obsolte simple_strtoul()

Soothes checkpatch warning:

    WARNING: simple_strtoul is obsolete, use kstrtoul instead
    #306: FILE: drivers/mfd/aat2870-core.c:306:
    +   addr = simple_strtoul(start, &start, 16);

Signed-off-by: Lee Jones <lee.jones@linaro.org>

Linux kernel releases containing commit 0ebc1c2

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "mfd: aat2870-core: Stop using obsolte simple_strtoul()"

There are 5 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/mfd/aat2870-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 14d9542a4eed..4e6e03d63e12 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -303,7 +303,10 @@ static ssize_t aat2870_reg_write_file(struct file *file,
 	while (*start == ' ')
 		start++;
 
-	addr = simple_strtoul(start, &start, 16);
+	ret = kstrtoul(start, 16, &addr);
+	if (ret)
+		return ret;
+
 	if (addr >= AAT2870_REG_NUM) {
 		dev_err(aat2870->dev, "Invalid address, 0x%lx\n", addr);
 		return -EINVAL;

The commit for this change in Linux stable tree is 0ebc1c2 (patch).

Last modified: 2020/02/10