mailbox: PCC: Fix return value of pcc_mbox_request_channel()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Signed-off-by Hoan Tran <[email protected]>
--- include/acpi/pcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/acpi/pcc.h +1 -1
@@ -21,7 +21,7 @@ extern 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) { -return NULL ; +return ERR_PTR (-ENODEV ); }static inline void pcc_mbox_free_channel (struct mbox_chan *chan) { }#endif
Signature · 1 line
1.9.1
Rafael J. Wysocki
AppliedQuoted 16 lines · Hoan Tran
When
CONFIG_PCCis disabled,pcc_mbox_request_channel()needs to returnERR_PTR(-ENODEV), not a NULL pointer, as the callers of this function useIS_ERR()to check for error code.Signed-off-by Duc Dang <[email protected]>Signed-off-by Hoan Tran <[email protected]>--- include/acpi/pcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/acpi/pcc.h +0
-0
include/acpi/pcc.h extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl, · line 27
Quoted 8 lines
include/acpi/pcc.h +1
-1@@ -21,7 +21,7 @@ extern 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) { -return NULL ; +return ERR_PTR (-ENODEV ); }static inline void pcc_mbox_free_channel (struct mbox_chan *chan) { }#endif
Applied.
Thanks,
Rafael