lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] hwmon: (xgene) fix return value in xgene_hwmon_probe()
Date
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 <songkai01@inspur.com>
---
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
\
 
 \ /
  Last update: 2021-10-22 10:46    [W:0.040 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site