summaryrefslogtreecommitdiffstats
path: root/drivers/cxl
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2022-04-04 04:12:14 +0200
committerDan Williams <dan.j.williams@intel.com>2022-04-13 01:07:01 +0200
commitcbe83a2052682c6f57d45f76fe7fea4bf254acd9 (patch)
tree5e0d364224993b586871f2a2fa7e283261b5c9d8 /drivers/cxl
parentcxl/mbox: Drop mbox_mutex comment (diff)
downloadlinux-cbe83a2052682c6f57d45f76fe7fea4bf254acd9.tar.xz
linux-cbe83a2052682c6f57d45f76fe7fea4bf254acd9.zip
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: Davidlohr Bueso <dave@stgolabs.net> Reviewed by: Adam Manzanares <a.manzanares@samsung.com> Link: https://lore.kernel.org/r/20220404021216.66841-3-dave@stgolabs.net Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl')
-rw-r--r--drivers/cxl/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index 3f2182d66829..94a91048e2f6 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -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 */