Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8518125ybl; Thu, 16 Jan 2020 18:37:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxhkVVTKj16pRoJepBKeUMI2bhG9GZ/RBBzyQRfICEfgi79XJGBRJ2H4yK1H43GhnBIR//X X-Received: by 2002:aca:cf11:: with SMTP id f17mr1849015oig.40.1579228632140; Thu, 16 Jan 2020 18:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579228632; cv=none; d=google.com; s=arc-20160816; b=oyJ8LbqqtQA0h+OSmu8nRMeivY7/Sp3OsTX8XtRw2Rru/y9OFKiHWzIa7LY7lIR++O jrPtediXkRomH6Hsdlh5hUebxyurhdIx8pDZYc3gh7sAG4E7rGDsmUaxw3HHULyYIPew gJng/m77+TKD39t0jHmeaGCaZpwe6wYRGinh6ZV/W0lzoZOOY00ZI5/Z8jSFP6cV3/Ac 7g8rXEsvDGIfoEJlF1AbLIBaY0K6i8sIbSFbWbh7IPAOm8PRtr/V7wWsxUsjIm7S/2c3 Ff52spKync8xB9yWMoxmn+7tzSKHbKuGGVfzzkrRpiwjZDkyvYudR3K7tJYo7iFm52o+ SJOg== 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=l3IjWzhCEMHK2p3m4g2hP5II14JG8E8vgiOdpX+kUsw=; b=GYSbL4VkrK/jbKeseIWyHmWtF0DvTqKi7PlioaDLpoYTxllBQ6FH5K1cC/Jde4of+U ZgoTpQj96+CyXoAbyopLa3y40VZC70glGZ+qIg08qBGL5BqYlK4DSu+rvmVjG7QXvVUI ANttn9yX0a/SevIcj19Amy3rb63kAuMhdZ6j44uCCk1UHzvqD08fb7NHB/x2q5i5l3OL CBV0HlliWLq1ZAmad5ksqBADfirJtkZ9/XIWkzFoN/rD81YT3mas2qHZBhS3/3ArP5d5 aGkXRQ4EsvHJ+2lIMYYZK3uq0zWvp8EsGJ39v4ORaPmhGhHwVfliklGofp2B007bxtoY uZ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eAbeqtqP; 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 30si14044717otr.75.2020.01.16.18.37.00; Thu, 16 Jan 2020 18:37:12 -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=eAbeqtqP; 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 S2390240AbgAPX1c (ORCPT + 99 others); Thu, 16 Jan 2020 18:27:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:55070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391059AbgAPXZZ (ORCPT ); Thu, 16 Jan 2020 18:25:25 -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 A8D232072B; Thu, 16 Jan 2020 23:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217125; bh=v2FokBu7CpE1c9BJ9W6832AKTtSktqysahYvauF6zKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eAbeqtqPoIeVn+76QruIz4IhFbigNJ1MvDiq+xCOpUniyRgvfZykTM9RL1UQ1aBxC BygbDJ+M5ugkp7Y+OPcULkM1XoMQYcYgV6wxNp0ZGoesBIl5FdjCWFOVoSceyVKFDk 9ohg7Sk1EABKLa0KVav0pVC2q03VCm57NU9FaNN0= 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 Subject: [PATCH 5.4 141/203] MIPS: Loongson: Fix return value of loongson_hwmon_init Date: Fri, 17 Jan 2020 00:17:38 +0100 Message-Id: <20200116231757.315916675@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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 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 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: Greg Kroah-Hartman --- 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; }