mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
MIPS: Loongson: Fix return value of loongson_hwmon_init
commitdece3c2a32
upstream. When call function hwmon_device_register failed, use the actual return value instead of always -ENOMEM. Fixes:64f09aa967
("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>
This commit is contained in:
parent
957978aa56
commit
2ca8c763ae
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue