Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp466786ybl; Tue, 28 Jan 2020 06:25:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwmR4GeUBZc2Ft2xb3CY3jiKOFeZTOcjLQ2hbYaEOfQdhLe7Ulitngm8WXJiDlCXweP22LR X-Received: by 2002:a05:6830:154a:: with SMTP id l10mr16752689otp.44.1580221510046; Tue, 28 Jan 2020 06:25:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221510; cv=none; d=google.com; s=arc-20160816; b=aaY8M7dXkc7hqXzPUEL3coPfQuTg8l23DKMIOwfaFNUYMmhmEE7B4ehpMvgqFX7NKN OM6YN9x91P59UOmxRcvZBfdPf/7MZdGbav6CHnzPAdyHpF0tWu62pM1ULuqjzzHm3nE9 Hp3mqHe+2yrzEFa2+Yq+0ThV3XysYAc+Ar7nr6Bxv41gGwROq5QQcavdrHx5y4QMI7O+ bG8A4nYMcsKzLq5+81NPyVI3iZUDTtSbiQBJXlH+gBkie9rCHtengg7w0ooOUFq6Gf19 koa65anAmYvTP//KqHwk1DB9fXdGvfKTtSCjXuqIerCuaP1HovD7gELnNcZv5NZgbBKU r/JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v4NItQnjKbawMqYDcwXMfEWVFM2zz6q4/TswKOM0SuI=; b=I+tlUfYWpQ/uOKh+x/3aGe9Rq1ql2kCLykYHQApR5RPaYg9asLz5FMXwtvK/vtWyGJ +KNzOociWoe4Yqx6k3Y3rkXfpW5UrC+G9CVRTmo9RHW1r36VqwzAzu1Gc9KOBWpLwF8s xvUnexEs71U01GXpqGeKkeTPgyAfCs0EYIHjqDYevO3kzdQPOw9DTd6H203idwhTYCSE 4XJ9h8uPPXn2KyiO9wwAtYH4pZjQ2CI6KMuj9uoQzXEnpjkETIylCq67F4p5E33KT6YE wcEFx4SOiFd8Y+B0EhgJzRjbENx1NV0Eq3/zVCL0B2UTr6YK3g8xkCsxn7OUQ51cM9FI fBvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JYvEfdUX; 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 16si7132489oth.99.2020.01.28.06.24.57; Tue, 28 Jan 2020 06:25:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JYvEfdUX; 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 S1731380AbgA1OYH (ORCPT + 99 others); Tue, 28 Jan 2020 09:24:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:50458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731386AbgA1OYB (ORCPT ); Tue, 28 Jan 2020 09:24:01 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D990E24686; Tue, 28 Jan 2020 14:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221440; bh=Ie4jcGFAb0xxjgmm9qal0iuc6BSGnHMiGldwTz30QUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JYvEfdUXfcE88uiC8X4L12bIf/frKimzF2WnrpGR5nUEASEW9fmFT08I6i7is3qRe 4UlbymjVxJfkwQWspjDVc4waWN7rkbcBfpf1wcn9HRYL1CINVV5CoVX3xlFxcHFea8 KPLA6HEk8J9Y8FGt7wEmVZm2mqZY+DQy0itPcL2Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tiezhu Yang , Paul Burton , Ralf Baechle , James Hogan , Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org, Sasha Levin Subject: [PATCH 4.9 224/271] MIPS: Loongson: Fix return value of loongson_hwmon_init Date: Tue, 28 Jan 2020 15:06:13 +0100 Message-Id: <20200128135909.231827436@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tiezhu Yang [ Upstream commit dece3c2a320b0a6d891da6ff774ab763969b6860 ] 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 Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: Huacai Chen Cc: Jiaxun Yang Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Sasha Levin --- 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 4300a558d0f39..d02214a3f8e3f 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -155,7 +155,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.20.1