diff mbox

[3.11.y.z,extended,stable] Patch "hwmon: (emc2103) Fix return value" has been added to staging queue

Message ID 1405951230-2329-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques July 21, 2014, 2 p.m. UTC
This is a note to let you know that I have just added a patch titled

    hwmon: (emc2103) Fix return value

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From 4d809802d91b23ce68bc320b25b1abaf05c63350 Mon Sep 17 00:00:00 2001
From: Sachin Kamat <sachin.kamat@linaro.org>
Date: Wed, 11 Sep 2013 09:49:48 +0530
Subject: [PATCH 25/41] hwmon: (emc2103) Fix return value

commit 1a3abbd0b9a16e40fd4718f99896c437a193c0a1 upstream.

kstrtol() returns appropriate error values. Use those instead of
hardcoding. Silences several sparse messages of following type:
"why not propagate 'result' from kstrtol() instead of (-22)?"

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 drivers/hwmon/emc2103.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--
1.9.1
diff mbox

Patch

diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c
index b07305622087..2c137b26acb4 100644
--- a/drivers/hwmon/emc2103.c
+++ b/drivers/hwmon/emc2103.c
@@ -248,7 +248,7 @@  static ssize_t set_temp_min(struct device *dev, struct device_attribute *da,

 	int result = kstrtol(buf, 10, &val);
 	if (result < 0)
-		return -EINVAL;
+		return result;

 	val = DIV_ROUND_CLOSEST(val, 1000);
 	if ((val < -63) || (val > 127))
@@ -272,7 +272,7 @@  static ssize_t set_temp_max(struct device *dev, struct device_attribute *da,

 	int result = kstrtol(buf, 10, &val);
 	if (result < 0)
-		return -EINVAL;
+		return result;

 	val = DIV_ROUND_CLOSEST(val, 1000);
 	if ((val < -63) || (val > 127))
@@ -320,7 +320,7 @@  static ssize_t set_fan_div(struct device *dev, struct device_attribute *da,

 	int status = kstrtol(buf, 10, &new_div);
 	if (status < 0)
-		return -EINVAL;
+		return status;

 	if (new_div == old_div) /* No change */
 		return count;
@@ -394,7 +394,7 @@  static ssize_t set_fan_target(struct device *dev, struct device_attribute *da,

 	int result = kstrtol(buf, 10, &rpm_target);
 	if (result < 0)
-		return -EINVAL;
+		return result;

 	/* Datasheet states 16384 as maximum RPM target (table 3.2) */
 	if ((rpm_target < 0) || (rpm_target > 16384))
@@ -440,7 +440,7 @@  static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,

 	int result = kstrtol(buf, 10, &new_value);
 	if (result < 0)
-		return -EINVAL;
+		return result;

 	mutex_lock(&data->update_lock);
 	switch (new_value) {