Skip to contentSkip to conversation

power: replace strict_strtoul() with kstrtoul()

PATCH In review Jingoo Han 2 participants 2 messages Jun 1, 2013 – Jun 2, 2013

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

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

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

---
 drivers/power/ab8500_fg.c        |    4 ++--
 drivers/power/pcf50633-charger.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/power/ab8500_fg.c +2 -2
index c5391f5..6207b5e 100644
@@ -2467,7 +2467,7 @@ static ssize_t charge_full_store(struct ab8500_fg *di, const char *buf,
 	unsigned long charge_full;
 	ssize_t ret = -EINVAL;
 
-	ret = strict_strtoul(buf, 10, &charge_full);
+	ret = kstrtoul(buf, 10, &charge_full);
 
 	dev_dbg(di->dev, "Ret %zd charge_full %lu", ret, charge_full);
 
@@ -2489,7 +2489,7 @@ static ssize_t charge_now_store(struct ab8500_fg *di, const char *buf,
 	unsigned long charge_now;
 	ssize_t ret;
 
-	ret = strict_strtoul(buf, 10, &charge_now);
+	ret = kstrtoul(buf, 10, &charge_now);
 
 	dev_dbg(di->dev, "Ret %zd charge_now %lu was %d",
 		ret, charge_now, di->bat_cap.prev_mah);
drivers/power/pcf50633-charger.c +2 -2
index 17fd77f..92f0ea0 100644
@@ -191,7 +191,7 @@ static ssize_t set_usblim(struct device *dev,
 	unsigned long ma;
 	int ret;
 
-	ret = strict_strtoul(buf, 10, &ma);
+	ret = kstrtoul(buf, 10, &ma);
 	if (ret)
 		return -EINVAL;
 
@@ -228,7 +228,7 @@ static ssize_t set_chglim(struct device *dev,
 	if (!mbc->pcf->pdata->charger_reference_current_ma)
 		return -ENODEV;
 
-	ret = strict_strtoul(buf, 10, &ma);
+	ret = kstrtoul(buf, 10, &ma);
 	if (ret)
 		return -EINVAL;
 
Signature · 1 line
1.7.10.4
#1 lore raw

drivers/power/ab8500_fg.c static ssize_t charge_full_store(struct ab8500_fg *di, const char *buf, · line 2468

Quoted 9 lines · Jingoo Han

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

drivers/power/ab8500_fg.c +0 -0
@@ -2467,7 +2467,7 @@ static ssize_t charge_full_store(struct ab8500_fg *di, const char *buf,
        unsigned long charge_full;
        ssize_t ret = -EINVAL;

Redundant assignment.

drivers/power/pcf50633-charger.c static ssize_t set_usblim(struct device *dev, · line 196

Quoted 10 lines
drivers/power/pcf50633-charger.c +1 -1
@@ -191,7 +191,7 @@ static ssize_t set_usblim(struct device *dev,
        unsigned long ma;
        int ret;
 
-       ret = strict_strtoul(buf, 10, &ma);
+       ret = kstrtoul(buf, 10, &ma);
        if (ret)
                return -EINVAL;

return ret;

drivers/power/pcf50633-charger.c static ssize_t set_chglim(struct device *dev, · line 233

Quoted 8 lines
drivers/power/pcf50633-charger.c +1 -1
@@ -228,7 +228,7 @@ static ssize_t set_chglim(struct device *dev,
        if (!mbc->pcf->pdata->charger_reference_current_ma)
                return -ENODEV;
 
-       ret = strict_strtoul(buf, 10, &ma);
+       ret = kstrtoul(buf, 10, &ma);
        if (ret)
                return -EINVAL;

Ditto.

--
With Best Regards,
Andy Shevchenko