Skip to contentSkip to conversation

drm/nouveau/hwmon: replace strict_strtol() with kstrtol()

PATCH In review Jingoo Han 2 participants 2 messages Feb 5, 2014 – Feb 7, 2014

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 drm/nouveau/hwmon: replace strict_strtol() with kstrtol()

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

---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_hwmon.c +3 -2
index 4aff04f..34ad3fa 100644
@@ -383,8 +383,9 @@ nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a,
 	long value;
 	int ret;
 
-	if (strict_strtol(buf, 10, &value) == -EINVAL)
-		return -EINVAL;
+	ret = kstrtol(buf, 10, &value);
+	if (ret)
+		return ret;
 
 	ret = therm->attr_set(therm, NOUVEAU_THERM_ATTR_FAN_MODE, value);
 	if (ret)
Signature · 1 line
1.7.10.4
#1 lore raw

----- Original Message -----

Quoted 10 lines

From: "Jingoo Han" <[email protected]>
To: "Ben Skeggs" <[email protected]>
Cc: [email protected], "David Airlie" <[email protected]>, "Jingoo Han" <[email protected]>
Sent: Wednesday, 5 February, 2014 12:02:59 PM
Subject: [PATCH] drm/nouveau/hwmon: replace strict_strtol() with kstrtol()

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

Picked it up. Thanks!

Quoted 28 lines
---
 drivers/gpu/drm/nouveau/nouveau_hwmon.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_hwmon.c +3 -2
index 4aff04f..34ad3fa 100644
@@ -383,8 +383,9 @@ nouveau_hwmon_set_pwm1_enable(struct device *d, struct
 device_attribute *a,
 	long value;
 	int ret;
 
-	if (strict_strtol(buf, 10, &value) == -EINVAL)
-		return -EINVAL;
+	ret = kstrtol(buf, 10, &value);
+	if (ret)
+		return ret;
 
 	ret = therm->attr_set(therm, NOUVEAU_THERM_ATTR_FAN_MODE, value);

if (ret)
--
1.7.10.4