Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hoan Tran and committed by
Rafael J. Wysocki
d0679cfa b59c4b3d

+1 -1
+1 -1
include/acpi/pcc.h
··· 21 21 static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl, 22 22 int subspace_id) 23 23 { 24 - return NULL; 24 + return ERR_PTR(-ENODEV); 25 25 } 26 26 static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { } 27 27 #endif