Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3955253ybx; Mon, 4 Nov 2019 05:35:09 -0800 (PST) X-Google-Smtp-Source: APXvYqxvVQaQLRkoLo+fZPNExf3Bm3mngQqH43cs2YDTVqNIalZCwy8klLzNKshVRwRrVmCTjGfw X-Received: by 2002:aa7:ca4a:: with SMTP id j10mr862489edt.54.1572874508976; Mon, 04 Nov 2019 05:35:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572874508; cv=none; d=google.com; s=arc-20160816; b=HaW1LeYyMXIsQBRN+l4bO5wEyxQp58h6DYn9e4GOTillV9bKwaL8XpLcmT96c4YRD5 dUoSTzJv7lXkPZcEwd71JuT0Uvm+RY12/VHbKn9zTbhMJvRbFa+jnXhiLzgK36jHdBBY /v/uEiht8PMLSevu8+dDthv546GPR+dfLSq8cMGGw5xDTyNCZTNaOSycJOxMdX/8SuMI jjUr6lH/lpL4xx7hb4nXEqWGd1kvH6GMzAN5mn9/GlRGpQ5D4gZm1LtjZ6Pw6hONBhIG VSB6DiDozcHyFFveadbxSQbPY/sOXYcNMB3bm0yE0pcLnME4oMmRN06WiMu4UWd6jqxZ 0xVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=/+AgitamaeSc4XjlDnjzHiGUOZuSsYS8TwYP9xmPqks=; b=XiBZQyrWFd4eWcMWZhL07e92DKig8K499NX8b9C69doG2+JV88V72f39+BU1bDdKqk 3RE5FJkAJ6XQySNvXrt5kTdHMk5Z/lUFlW3oQ2JtSGHQYIZzpsVl6spIp3NMtm4v7lul t3gKWLUcr/Za3ml913LOtZEYDGJr+9OD5zGEgyWT0MrzKOfa9ocnYe1ulrY32SGz9hvq bRnfrGswtWdm16U86ME+Lrw+w4+QPMdvNGaP82c5ljG18m5obpzjaGai9wv6lwJ+AQgO Sx3ytQ6UKsEpMDvfpEwugtcOjY5HSQYLGqhWr78J2KVFN5aV4zwa5/UxjiLRVLm+y+Ru OKgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si374689eds.247.2019.11.04.05.34.45; Mon, 04 Nov 2019 05:35:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729094AbfKDNeS (ORCPT + 99 others); Mon, 4 Nov 2019 08:34:18 -0500 Received: from mail.loongson.cn ([114.242.206.163]:46782 "EHLO mail.loongson.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbfKDNeS (ORCPT ); Mon, 4 Nov 2019 08:34:18 -0500 Received: from linux.loongson.cn (unknown [10.20.41.27]) by mail (Coremail) with SMTP id QMiowPDxf2DSKMBdOMMbAA--.11S2; Mon, 04 Nov 2019 21:34:10 +0800 (CST) From: Tiezhu Yang To: Paul Burton , Ralf Baechle , James Hogan , Huacai Chen , Jiaxun Yang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: Loongson: Fix return value of loongson_hwmon_init Date: Mon, 4 Nov 2019 21:33:50 +0800 Message-Id: <1572874430-28903-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: QMiowPDxf2DSKMBdOMMbAA--.11S2 X-Coremail-Antispam: 1UD129KBjvdXoWruryktryxtF1kCw48tFWkZwb_yoWfJFcE9r 409ryxXrn5KrnI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ger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/platform/mips/cpu_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c index 1833b51..0d27cb7 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; } -- 2.1.0