diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2019-11-04 21:33:50 +0800 |
---|---|---|
committer | Paul Burton <paulburton@kernel.org> | 2019-11-04 10:50:55 -0800 |
commit | dece3c2a320b0a6d891da6ff774ab763969b6860 (patch) | |
tree | 96d808ae8e8445c1f681f827485645e608aa930b /drivers/platform | |
parent | 7505576d1c1ac0cfe85fdf90999433dd8b673012 (diff) | |
download | linux-dece3c2a320b0a6d891da6ff774ab763969b6860.tar.bz2 |
MIPS: Loongson: Fix return value of loongson_hwmon_init
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
Diffstat (limited to 'drivers/platform')
-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 1833b51690e5..0d27cb7a9e3c 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -176,7 +176,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; } |