Skip to contentSkip to conversation

iio: replace strict_strtoul() with kstrtoul()

PATCH Applied Jingoo Han 2 participants 2 messages Jun 1, 2013 – Jun 2, 2013 IIO

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 iio: replace strict_strtoul() with kstrtoul()

The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used.

---
 drivers/iio/adc/max1363.c            |    2 +-
 drivers/iio/trigger/iio-trig-sysfs.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/iio/adc/max1363.c +1 -1
index 9e6da72..f148d00 100644
@@ -660,7 +660,7 @@ static ssize_t max1363_monitor_store_freq(struct device *dev,
 	unsigned long val;
 	bool found = false;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret)
 		return -EINVAL;
 	for (i = 0; i < ARRAY_SIZE(max1363_monitor_speeds); i++)
drivers/iio/trigger/iio-trig-sysfs.c +2 -2
index b727bde..effcd0a 100644
@@ -34,7 +34,7 @@ static ssize_t iio_sysfs_trig_add(struct device *dev,
 	int ret;
 	unsigned long input;
 
-	ret = strict_strtoul(buf, 10, &input);
+	ret = kstrtoul(buf, 10, &input);
 	if (ret)
 		return ret;
 	ret = iio_sysfs_trigger_probe(input);
@@ -53,7 +53,7 @@ static ssize_t iio_sysfs_trig_remove(struct device *dev,
 	int ret;
 	unsigned long input;
 
-	ret = strict_strtoul(buf, 10, &input);
+	ret = kstrtoul(buf, 10, &input);
 	if (ret)
 		return ret;
 	ret = iio_sysfs_trigger_remove(input);
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw
Quoted 4 lines · Jingoo Han

The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used.

hmmm. Normally I'd only take this sort of change if it were part of a large scale cleanup of a driver, but as those are both my drivers what the heck, I'll take it.

Applied to the togreg branch of iio.git.

Quoted 42 lines
---
 drivers/iio/adc/max1363.c            |    2 +-
 drivers/iio/trigger/iio-trig-sysfs.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/iio/adc/max1363.c +1 -1
index 9e6da72..f148d00 100644
@@ -660,7 +660,7 @@ static ssize_t max1363_monitor_store_freq(struct device *dev,
 	unsigned long val;
 	bool found = false;
 
-	ret = strict_strtoul(buf, 10, &val);
+	ret = kstrtoul(buf, 10, &val);
 	if (ret)
 		return -EINVAL;
 	for (i = 0; i < ARRAY_SIZE(max1363_monitor_speeds); i++)
drivers/iio/trigger/iio-trig-sysfs.c +2 -2
index b727bde..effcd0a 100644
@@ -34,7 +34,7 @@ static ssize_t iio_sysfs_trig_add(struct device *dev,
 	int ret;
 	unsigned long input;
 
-	ret = strict_strtoul(buf, 10, &input);
+	ret = kstrtoul(buf, 10, &input);
 	if (ret)
 		return ret;
 	ret = iio_sysfs_trigger_probe(input);
@@ -53,7 +53,7 @@ static ssize_t iio_sysfs_trig_remove(struct device *dev,
 	int ret;
 	unsigned long input;
 
-	ret = strict_strtoul(buf, 10, &input);
+	ret = kstrtoul(buf, 10, &input);
 	if (ret)
 		return ret;
 	ret = iio_sysfs_trigger_remove(input);