i3c: mipi-i3c-hci: Do not overallocate transfers in hci_cmd_v1_daa()

Function hci_cmd_v1_daa() uses only single transfer at a time so no need
to allocate two transfers and access can be simplified.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20231109133708.653950-3-jarkko.nikula@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Jarkko Nikula 2023-11-09 15:37:06 +02:00 committed by Alexandre Belloni
parent 9e0e9e85e7
commit 0be1a06c66

View file

@ -298,7 +298,7 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
unsigned int dcr, bcr; unsigned int dcr, bcr;
DECLARE_COMPLETION_ONSTACK(done); DECLARE_COMPLETION_ONSTACK(done);
xfer = hci_alloc_xfer(2); xfer = hci_alloc_xfer(1);
if (!xfer) if (!xfer)
return -ENOMEM; return -ENOMEM;
@ -339,12 +339,12 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
ret = -ETIME; ret = -ETIME;
break; break;
} }
if (RESP_STATUS(xfer[0].response) == RESP_ERR_NACK && if (RESP_STATUS(xfer->response) == RESP_ERR_NACK &&
RESP_DATA_LENGTH(xfer->response) == 1) { RESP_DATA_LENGTH(xfer->response) == 1) {
ret = 0; /* no more devices to be assigned */ ret = 0; /* no more devices to be assigned */
break; break;
} }
if (RESP_STATUS(xfer[0].response) != RESP_SUCCESS) { if (RESP_STATUS(xfer->response) != RESP_SUCCESS) {
ret = -EIO; ret = -EIO;
break; break;
} }