diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-09-13 21:59:27 +0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-10-14 03:16:26 +0400 |
commit | 674d0ed8588c11ec9f70c8427ac83a73e0d156d5 (patch) | |
tree | b9494f789c84371fa68af0bcc6307f392d5ef77d /include/linux/hwmon-vid.h | |
parent | 19f053c8406542eafb534b33d698677f076a3421 (diff) | |
download | linux-674d0ed8588c11ec9f70c8427ac83a73e0d156d5.tar.xz |
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 'include/linux/hwmon-vid.h')
-rw-r--r-- | include/linux/hwmon-vid.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index f346e4d5381c..da0a680e2f6d 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -38,7 +38,7 @@ static inline int vid_to_reg(int val, u8 vrm) return ((val >= 1100) && (val <= 1850) ? ((18499 - val * 10) / 25 + 5) / 10 : -1); default: - return -1; + return -EINVAL; } } |