summaryrefslogtreecommitdiff
path: root/drivers/cxl/core
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2022-04-03 19:12:16 -0700
committerDan Williams <dan.j.williams@intel.com>2022-04-12 16:07:02 -0700
commitc43e036d6f861f4c68b50eea49ab55b539eaab02 (patch)
treecf4bf5fb102a9302530a86938c21f30247445c40 /drivers/cxl/core
parent92fcc1abab095dceb2337444f79875c8a85063df (diff)
cxl/mbox: Use new return_code handling
Use the global cxl_mbox_cmd_rc table to improve debug messaging in __cxl_pci_mbox_send_cmd() and allow cxl_mbox_send_cmd() to map to proper kernel style errno codes - this patch continues to use -ENXIO only so no change in semantics. Signed-off-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed by: Adam Manzanares <a.manzanares@samsung.com> Link: https://lore.kernel.org/r/20220404021216.66841-5-dave@stgolabs.net Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl/core')
-rw-r--r--drivers/cxl/core/mbox.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 5adc0ddb1737..8a8388599a85 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -180,9 +180,8 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in,
if (rc)
return rc;
- /* TODO: Map return code to proper kernel style errno */
if (mbox_cmd.return_code != CXL_MBOX_CMD_RC_SUCCESS)
- return -ENXIO;
+ return cxl_mbox_cmd_rc2errno(&mbox_cmd);
/*
* Variable sized commands can't be validated and so it's up to the