diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2019-11-04 16:33:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-17 21:48:55 +0300 |
commit | 2ca8c763ae0cb517de6058cb9142877c96220a03 (patch) | |
tree | 2ade54398f7eda291467d04d5b1dd028da86cd40 | |
parent | 957978aa56f13e6d7493a139edc9cbade78e78c4 (diff) | |
download | linux-2ca8c763ae0cb517de6058cb9142877c96220a03.tar.xz |
MIPS: Loongson: Fix return value of loongson_hwmon_init
commit dece3c2a320b0a6d891da6ff774ab763969b6860 upstream.
When call function hwmon_device_register failed, use the actual
return value instead of always -ENOMEM.
Fixes: 64f09aa967e1 ("MIPS: Loongson-3: Add CPU Hwmon platform driver")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/platform/mips/cpu_hwmon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c index a7f184bb47e0..3d29a11c1d6b 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -161,7 +161,7 @@ static int __init loongson_hwmon_init(void) cpu_hwmon_dev = hwmon_device_register(NULL); if (IS_ERR(cpu_hwmon_dev)) { - ret = -ENOMEM; + ret = PTR_ERR(cpu_hwmon_dev); pr_err("hwmon_device_register fail!\n"); goto fail_hwmon_device_register; } |