kernel/fogo:fix The device automatically restarts during use

fogo:
fix spi read write driver

Change-Id: I5a74bee3eb109f898529f1459303c18544ca2ba1
Reviewed-on: https://gerrit.mot.com/2790440
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
zhongfeihong 2023-11-09 13:46:28 +08:00 • committed by hq132
commit 47cbbdadeb

View file

@ -414,7 +414,12 @@ int32_t CTP_SPI_READ(struct spi_device *client, uint8_t *buf, uint16_t len)
while (retries < 5) {
ret = spi_read_write(client, buf, len, NVTREAD);
if (ret == 0) break;
if (ret == 0)
break;
else if (ret == -ETIMEDOUT) {
NVT_ERR("read error, ret = %d\n", ret);
break;
}
retries++;
}
@ -448,7 +453,13 @@ int32_t CTP_SPI_WRITE(struct spi_device *client, uint8_t *buf, uint16_t len)
while (retries < 5) {
ret = spi_read_write(client, buf, len, NVTWRITE);
if (ret == 0) break;
if (ret == 0)
break;
else if (ret == -ETIMEDOUT) {
NVT_ERR("write error, ret = %d\n", ret);
break;
}
retries++;
}