浏览代码

mailbox: PCC: Fix return value of pcc_mbox_request_channel()

When CONFIG_PCC is disabled, pcc_mbox_request_channel() needs to
return ERR_PTR(-ENODEV), not a NULL pointer, as the callers of
this function use IS_ERR() to check for error code.

Signed-off-by: Duc Dang <dhdang@apm.com>
Signed-off-by: Hoan Tran <hotran@apm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Hoan Tran 8 年之前
父节点
当前提交
d0679cfaf5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/acpi/pcc.h

+ 1 - 1
include/acpi/pcc.h

@@ -21,7 +21,7 @@ extern void pcc_mbox_free_channel(struct mbox_chan *chan);
 static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 							 int subspace_id)
 							 int subspace_id)
 {
 {
-	return NULL;
+	return ERR_PTR(-ENODEV);
 }
 }
 static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
 static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
 #endif
 #endif