public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mxs_spi: Return proper timeout error
Date: Mon, 19 Mar 2012 04:40:17 +0100	[thread overview]
Message-ID: <201203190440.17541.marex@denx.de> (raw)
In-Reply-To: <1332127415-4903-1-git-send-email-festevam@gmail.com>

Dear Fabio Estevam,

> Instead of returning -1, it is preferred to return -ETIMEDOUT in case of
> timeouts.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/spi/mxs_spi.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
> index adb9ca8..4e6f14e 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;
>  		}
>  	}

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

  reply	other threads:[~2012-03-19  3:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19  3:23 [U-Boot] [PATCH] mxs_spi: Return proper timeout error Fabio Estevam
2012-03-19  3:40 ` Marek Vasut [this message]
2012-03-19  3:43 ` Mike Frysinger
2012-03-19  3:48   ` Marek Vasut
2012-03-20  8:00 ` Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201203190440.17541.marex@denx.de \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox