lkml.org 
[lkml]   [2020]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 141/203] MIPS: Loongson: Fix return value of loongson_hwmon_init
    Date
    From: Tiezhu Yang <yangtiezhu@loongson.cn>

    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>

    ---
    drivers/platform/mips/cpu_hwmon.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/platform/mips/cpu_hwmon.c
    +++ b/drivers/platform/mips/cpu_hwmon.c
    @@ -161,7 +161,7 @@ static int __init loongson_hwmon_init(vo

    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;
    }

    \
     
     \ /
      Last update: 2020-01-17 00:42    [W:4.628 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site