summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2012-03-18 17:23:35 +0000
committerStefano Babic <sbabic@denx.de>2012-03-27 09:41:16 +0200
commitd9fb6a4c7e61d735eec2936a8dc3877f83e61d24 (patch)
tree5a154aff2e8a5fb9b27725008c87c3590a9fda93 /drivers/spi
parenta89300338a0d0c43ff21c50d793782c310c882ee (diff)
downloadu-boot-d9fb6a4c7e61d735eec2936a8dc3877f83e61d24.tar.gz
u-boot-d9fb6a4c7e61d735eec2936a8dc3877f83e61d24.tar.xz
u-boot-d9fb6a4c7e61d735eec2936a8dc3877f83e61d24.zip
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/mxs_spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index adb9ca8ec8..4e6f14ee07 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -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;
}
}