Commit cbe83a20 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Dan Williams

cxl/pci: Use CXL_MBOX_SUCCESS to check against mbox_cmd return code

Also mention the need for the caller to check against any
errors from the hardware in return_code.
Signed-off-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
Reviewed by: Adam Manzanares <a.manzanares@samsung.com>
Link: https://lore.kernel.org/r/20220404021216.66841-3-dave@stgolabs.netSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent ee92c7e2
......@@ -177,9 +177,9 @@ static int __cxl_pci_mbox_send_cmd(struct cxl_dev_state *cxlds,
mbox_cmd->return_code =
FIELD_GET(CXLDEV_MBOX_STATUS_RET_CODE_MASK, status_reg);
if (mbox_cmd->return_code != 0) {
if (mbox_cmd->return_code != CXL_MBOX_SUCCESS) {
dev_dbg(dev, "Mailbox operation had an error\n");
return 0;
return 0; /* completed but caller must check return_code */
}
/* #7 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment