Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1487954pxb; Fri, 22 Oct 2021 01:48:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRUXOoJ/fmlqT+bW7PEscjXOAnbRXAPR/MkSjkGf9WphS910R7jsGjkbTNcEVjepf8w45f X-Received: by 2002:a17:906:2511:: with SMTP id i17mr5291840ejb.371.1634892496490; Fri, 22 Oct 2021 01:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634892496; cv=none; d=google.com; s=arc-20160816; b=tHmSliv6pUBbnEpjhYBNddhQyN/jJTeuhaYrnkAr2rbOxoxDUj9ybVSBHOQjEAFqx+ spfn5bYx6y4phfliSKgo9DHzi3X2LXDBVq9ivtpVuvaE3P5kw7KlQyHYDLSlr+oHaWpg wf+dg1Nr70QKS21K9z6CXkJVZTvSeFZFw+C9j2C0FHUDfLWe+McoCdaSrNjppNnRRSNi 7xZtnkkDws03ylnPU1bFooS3yIUBjOm/W/9GJFDtlZqzDPb1czSbup6UOmGskGtzp3RT YhUCw5C/74Wf8f3JFeHJKv5JuW2DBNFbOA5Eb5vUboiGcPgIS2keoa66XWnmpHsX/Z1p 56mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=7w3WJT9EclSH0Y8s4k5XxgcT/NHkj/83tqlwk02ZK8g=; b=jRVVu8RYcK67eR76MIlJTDZao0skmuKaDDmZvblGxf6xHyNJYLUAQKzjRfXEfRQpaE GDXpby9rYBz/MNpwgbbXPDVlDgUJLt8lAPG8TkxHqeaaeVTwYMyQhJA5l98oTzlemCGC 5bX+Qiaqol5uCq+X0LoM+rZ0HHpsNRdJvVSxnz7ZDXo9auLZNm4nU/V8ssUUEE1PcNlO AybANOOyNLD7I2UH2nFzJFkJp8DMyc8XJsTZBkIN/JzFI5qjtmqZVwigtyqVrPGPwW+G uVM+hbcCPff+nGzqW4x/dMn+VRPCJZnws/tByQxsPMw2ysX8xiQR9ebATdLbwf9ANyKL 9xAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f28si2158861edc.20.2021.10.22.01.47.52; Fri, 22 Oct 2021 01:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbhJVIsV (ORCPT + 99 others); Fri, 22 Oct 2021 04:48:21 -0400 Received: from ssh248.corpemail.net ([210.51.61.248]:22353 "EHLO ssh248.corpemail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbhJVIsU (ORCPT ); Fri, 22 Oct 2021 04:48:20 -0400 Received: from ([60.208.111.195]) by ssh248.corpemail.net ((LNX1044)) with ASMTP (SSL) id QKQ00054; Fri, 22 Oct 2021 16:45:54 +0800 Received: from localhost.localdomain (10.200.104.119) by jtjnmail201604.home.langchao.com (10.100.2.4) with Microsoft SMTP Server id 15.1.2308.14; Fri, 22 Oct 2021 16:44:48 +0800 From: Kai Song To: , CC: , , Kai Song Subject: [PATCH] hwmon: (xgene) fix return value in xgene_hwmon_probe() Date: Fri, 22 Oct 2021 16:44:46 +0800 Message-ID: <20211022084446.16728-1-songkai01@inspur.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.200.104.119] tUid: 202110221645544c835134fcdd29043a56be9d49a3d297 X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It uses IS_ERR to judge the return value of mbox_request_channel() and pcc_mbox_request_channel().If it is invalid, maybe we should use PTR_ERR to get the correct return value. Signed-off-by: Kai Song --- drivers/hwmon/xgene-hwmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c index 382ef0395d8e..fd0847f251c0 100644 --- a/drivers/hwmon/xgene-hwmon.c +++ b/drivers/hwmon/xgene-hwmon.c @@ -648,7 +648,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev) if (IS_ERR(ctx->mbox_chan)) { dev_err(&pdev->dev, "SLIMpro mailbox channel request failed\n"); - rc = -ENODEV; + rc = PTR_ERR(ctx->mbox_chan); goto out_mbox_free; } } else { @@ -675,7 +675,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev) if (IS_ERR(ctx->mbox_chan)) { dev_err(&pdev->dev, "PPC channel request failed\n"); - rc = -ENODEV; + rc = PTR_ERR(ctx->mbox_chan); goto out_mbox_free; } -- 2.27.0