Commit dece3c2a authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Paul Burton

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: 64f09aa9 ("MIPS: Loongson-3: Add CPU Hwmon platform driver")
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: default avatarPaul 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
parent 7505576d
...@@ -176,7 +176,7 @@ static int __init loongson_hwmon_init(void) ...@@ -176,7 +176,7 @@ static int __init loongson_hwmon_init(void)
cpu_hwmon_dev = hwmon_device_register(NULL); cpu_hwmon_dev = hwmon_device_register(NULL);
if (IS_ERR(cpu_hwmon_dev)) { if (IS_ERR(cpu_hwmon_dev)) {
ret = -ENOMEM; ret = PTR_ERR(cpu_hwmon_dev);
pr_err("hwmon_device_register fail!\n"); pr_err("hwmon_device_register fail!\n");
goto fail_hwmon_device_register; goto fail_hwmon_device_register;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment