mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
mxs_spi: Return proper timeout error
Instead of returning -1, it is preferred to return -ETIMEDOUT in case of timeouts. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
a89300338a
commit
d9fb6a4c7e
1 changed files with 3 additions and 3 deletions
|
|
@ -162,7 +162,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
|
|||
if (mx28_wait_mask_set(&ssp_regs->hw_ssp_ctrl0_reg,
|
||||
SSP_CTRL0_RUN, MXS_SPI_MAX_TIMEOUT)) {
|
||||
printf("MXS SPI: Timeout waiting for start\n");
|
||||
return -1;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
if (tx)
|
||||
|
|
@ -174,7 +174,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
|
|||
if (mx28_wait_mask_clr(&ssp_regs->hw_ssp_status_reg,
|
||||
SSP_STATUS_FIFO_EMPTY, MXS_SPI_MAX_TIMEOUT)) {
|
||||
printf("MXS SPI: Timeout waiting for data\n");
|
||||
return -1;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
*rx = readl(&ssp_regs->hw_ssp_data);
|
||||
|
|
@ -184,7 +184,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
|
|||
if (mx28_wait_mask_clr(&ssp_regs->hw_ssp_ctrl0_reg,
|
||||
SSP_CTRL0_RUN, MXS_SPI_MAX_TIMEOUT)) {
|
||||
printf("MXS SPI: Timeout waiting for finish\n");
|
||||
return -1;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue