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] ACPI: CPPC: fix return value in register_pcc_channel()
Date
It uses IS_ERR to judge the return value of
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/acpi/cppc_acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index bd482108310c..0bbb5fa27ce7 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -503,7 +503,7 @@ static int register_pcc_channel(int pcc_ss_idx)
if (IS_ERR(pcc_data[pcc_ss_idx]->pcc_channel)) {
pr_err("Failed to find PCC channel for subspace %d\n",
pcc_ss_idx);
- return -ENODEV;
+ return PTR_ERR(pcc_data[pcc_ss_idx]->pcc_channel);
}

/*
--
2.27.0
\
 
 \ /
  Last update: 2021-10-22 09:40    [W:0.035 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site