diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-09-13 13:59:27 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-10-13 19:16:26 -0400 |
commit | 674d0ed8588c11ec9f70c8427ac83a73e0d156d5 (patch) | |
tree | b9494f789c84371fa68af0bcc6307f392d5ef77d /drivers/hwmon | |
parent | 19f053c8406542eafb534b33d698677f076a3421 (diff) |
hwmon: (atxp1) Set and use error code from vid_to_reg()
vid_to_reg() returns -1 if it encounters an error. Return -EINVAL instead.
Its only caller, atxp1_storevcore(), doesn't use the return code but
returns -1 instead, which is wrong anyway as it means -EPERM.
Use the return value from vid_to_reg() instead to report the error.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/atxp1.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index aecb9ea7beb5..ddff02e3e66f 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -147,10 +147,9 @@ static ssize_t atxp1_storevcore(struct device *dev, | |||
147 | 147 | ||
148 | /* Calculate VID */ | 148 | /* Calculate VID */ |
149 | vid = vid_to_reg(vcore, data->vrm); | 149 | vid = vid_to_reg(vcore, data->vrm); |
150 | |||
151 | if (vid < 0) { | 150 | if (vid < 0) { |
152 | dev_err(dev, "VID calculation failed.\n"); | 151 | dev_err(dev, "VID calculation failed.\n"); |
153 | return -1; | 152 | return vid; |
154 | } | 153 | } |
155 | 154 | ||
156 | /* | 155 | /* |